David Hatton
David Hatton

Reputation: 337

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

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?

Upvotes: 3

Views: 23705

Answers (2)

Patrik Šimunič
Patrik Šimunič

Reputation: 539

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

Upvotes: 2

David Hatton
David Hatton

Reputation: 337

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.

Upvotes: 6

Related Questions