Skip to content

configuration has an unknown property 'error' #1142

Closed
@patrik-simunic-cz

Description

@patrik-simunic-cz

Operating System: MacOS Sierra (10.12.6)
Node Version: v8.6.0
NPM Version: 5.3.0
webpack Version: ^3.6.0
webpack-dev-server Version: ^2.9.1

  • This is a bug
  • This is a feature request
  • This is a modification request

Code

webpack-dev-server throws this error message:

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? }

configuration has an unknown property 'error', though I don't have any property 'error' in my webpack.config.js (as can be seen bellow).

webpack.config.js

const path = require('path')
const webpack = require('webpack')
const CleanWebpackPlugin = require('clean-webpack-plugin')

module.exports = {
    entry: {
        bundle: path.resolve(__dirname, 'src/index.jsx'),
    },
    output: {
        publicPath: '/',
        path: __dirname + '/dist',
        filename: '[name].[chunkhash].js',
    },
    devServer: {
        host: '0.0.0.0',
        port: 8088,
        historyApiFallback: true,
    },
    module: {
        loaders: [{
            test: /.jsx?$/,
            loader: 'babel-loader',
            exclude: /node_modules/,
            query: {
                presets: ['es2015', 'react', 'stage-0'],
                plugins: ['transform-runtime'],
            },
        }],
    },
    plugins: [
        new CleanWebpackPlugin(['dist'], {
            root: path.resolve(__dirname),
            verbrose: true,
        }),
        new webpack.optimize.CommonsChunkPlugin({
            name: 'commons',
        }),
    ],
}

I'd normaly say that this is a problem on my side, but I've double checked the configuration many times and many times removed webpack and webpack-dev-server and installed them again, but this error stays... so I suppose this may be a bug in webpack-dev-server. Strange thing is, when I run webpack, it compiles without any error and bundles everything as it's supposed.

Expected Behavior

webpack-dev-server should compile and bundle the code and start dev server.

Actual Behavior

webpack-dev-server throws misconfiguration error.

For Bugs; How can we reproduce the behavior?

Run webpack-dev-server with the configuration snippets above.

For Features; What is the motivation and/or use-case for the feature?

EDIT:

I'm using webpack-dev-server via the CLI

EDIT 2:

Here is a simplified repo with replicated error: https://github.com/7h3w4rd0c70r/wds-misconfiguration-error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions