webpack-dev-server return "configuration has an unknown property 'error'"

19,525

Solution 1

The problem was related to the global installations mentioned at the end of the question. It appears that running webpack-dev-server from the project root caused both the project install and the global install to spring into action, thus they had a mutual port-conflict. One of them threw an error upon detecting this conflict, and the other one picked up this error thinking that it was additional configuration input.

Using the project install of webpack-dev-server resolved the issue.

Solution 2

Solved in webpack-dev-server library version 2.9.3 (global/local instance conflict).

Closed github issue: https://github.com/webpack/webpack-dev-server/issues/1142

Share:
19,525
David Hatton
Author by

David Hatton

I work as a developer for Cogiva Ltd. For fun I play command and conquer, as well as spending time gardening and cooking. In terms of programming, I've been doing it professionally since Jan 2015 and unprofessionally since 2002. Despite trying many, I have yet to decide whether I even have a favourite language.

Updated on June 04, 2022

Comments

  • David Hatton
    David Hatton almost 2 years

    I have webpack^3.0.0 and webpack-dev-server^2.9.1 installed (both on the project and globally). Upon running webpack-dev-server in the project root, I am presented with the error

    Invalid configuration object. webpack-dev-server has been initialised 
    using a configuration object that does not match the API schema.
     - configuration has an unknown property 'error'. These properties are 
    valid:
    object { hot?, hotOnly?, lazy?, bonjour?, host?, allowedHosts?, 
    filename?, publicPath?, port?, socket?, watchOptions?, headers?, 
    clientLogLevel?, overlay?, progress?, key?, cert?, ca?, pfx?, 
    pfxPassphrase?, requestCert?, inline?, disableHostCheck?, public?, 
    https?, contentBase?, watchContentBase?, open?, useLocalIp?, openPage?, 
    features?, compress?, proxy?, historyApiFallback?, staticOptions?, 
    setup?, before?, after?, stats?, reporter?, noInfo?, quiet?, 
    serverSideRender?, index?, log?, warn? }
    

    the webpack.config.js file at the projet root contains the following:

    module.exports = {
      entry: {
        app: [
          './src/index.js'
        ]
      },
      module: {
        loaders: [{
          test: /\.jsx?$/,
          exclude: /node_modules/,
          loader: 'babel-loader'
        }]
      },
      resolve: {
        extensions: ['*', '.js', '.jsx']
      },
      output: {
        path: __dirname + '/dist',
        publicPath: '/',
        filename: 'bundle.js'
      },
      devServer: {
        inline: false,
        contentBase: './dist'
      }
    };
    

    I have tried following the advice in this SO question but to no avail. How can I get webpack to start?

    I've also noticed that when I installed webpack-dev-server^2.9.1 globally, it refused to acknowledge its peer of webpack^3.0.0 despite the fact that it was present. Is that related?

  • Omer
    Omer over 6 years
    Exactly what I was looking for. I uninstalled the local webpack-dev-server and it works fine now. For some reason, npm start (which was configured to run webpack-dev-server) never threw any error.