title: webpack options has an unknown property 'hotOnly'. Invalid options object. Dev Server has been initialized using an options object
body: <p>I am running the command <code>npx webpack-dev-server --mode development</code> in my <code>react</code> application and getting the preceding error.</p>
  <pre><code>[webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
   - options has an unknown property 'hotOnly'. These properties are valid:
  </code></pre>
  <p>Below is my <code>webpack.config.js</code> file.</p>
  <pre><code>const path = require(&quot;path&quot;);
  const webpack = require(&quot;webpack&quot;);
  
  module.exports = {
    entry: &quot;./src/index.js&quot;,
    mode: &quot;development&quot;,
    module: {
      rules: [
        {
          test: /\.(js|jsx)$/,
          exclude: /(node_modules)/,
          loader: &quot;babel-loader&quot;,
          options: {
            presets: [&quot;@babel/env&quot;],
          },
        },
        {
          test: /\.css$/,
          use: [&quot;style-loader&quot;, &quot;css-loader&quot;],
        },
      ],
    },
    resolve: {
      extensions: [&quot;*&quot;, &quot;.js&quot;, &quot;.jsx&quot;],
    },
    output: {
      path: path.resolve(__dirname, &quot;dist/&quot;),
      publicPath: &quot;/dist/&quot;,
      filename: &quot;bundle.js&quot;,
    },
    devServer: {
      contentBase: path.join(__dirname, &quot;public/&quot;),
      port: 3000,
      publicPath: &quot;https://localhost:3000/dist/&quot;,
      hotOnly: true,
    },
    plugins: [new webpack.HotModuleReplacementPlugin()],
  };
  </code></pre>
  <p>Any idea what is causing this issue?</p>