Skip to content

Extraneous config option freezes execution with no error or log #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emilio-martinez opened this issue Nov 16, 2016 · 3 comments
Closed

Comments

@emilio-martinez
Copy link

I'm submitting a bug report

webpack and webpack-dev-server version:
webpack: 2.1.0-beta.26
webpack-dev-server: 2.1.0-beta.11

Please tell us about your environment:
OSX 10.11.6
Running server Node.js API

Current behavior:
Silent fail when providing an option to the devServer config that's outside of the schema.

Expected/desired behavior:
One of two:
a) handle the extraneous config option "gracefully" by either clearing the invalid option from the config or simply ignoring it if no harm could come by having it there
b) simply throw an error because an invalid option has been provided

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your Webpack configuration. Be sure to specify how you are running the server.

I brought this up on #654 where my config looked like:

devServer:
   { quiet: true,
     noInfo: true,
     compress: true,
     colors: true,
     contentBase: '/absolute/path/to/dir',
     publicPath: '/',
     port: 3000,
     hot: true,
     inline: true,
     historyApiFallback: true,
     host: '0.0.0.0',
     https: false,
     setup: [Function],
     staticOptions: { extensions: [Object] } }

In this example, colors is the extraneous config option and that will freeze the Webpack execution altogether. To clarify, this will happen regardless of what the extraneous config, and no error or log item is thrown; just radio silence. However, it's worth noting that there's an object returned from new webpackDevServer but listen doesn't seem to execute.

@SpaceK33z
Copy link
Member

SpaceK33z commented Nov 16, 2016

I tried to reproduce it with this example. In server.js, I added colors: true in the second parameter for new WebpackDevServer. This resulted in a proper error, as expected.

Could you share how you start the Node.js server? I noticed you're using devServer from your config. Note that the Node.js API will ignore the options in devServer, unless you specifically add it (e.g. new WebpackDevServer(compiler, config.devServer)).

@SpaceK33z
Copy link
Member

@emilio-martinez ping ^

@SpaceK33z
Copy link
Member

I'm closing this issue because of inactivity. Feel free to comment, and we can always re-open it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants