Webpack-dev-server: Warning prevents reload

Created on 9 Feb 2017  Â·  5Comments  Â·  Source: webpack/webpack-dev-server

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

  âš   http://eslint.org/docs/rules/no-console  Unexpected console statement  
  .../src/index.js:60:1
  console.log('foo');
   ^

✘ 1 problem (0 errors, 1 warning)

[WDS] App updated. Recompiling...
client?843a:40 [WDS] Errors while compiling. Reload prevented.

I've seen previous issues where this is considered a bug (such as #707) and was fixed and closed at the time.

If the current behavior is a bug, please provide the steps to reproduce.

Add a warning scenario with ESLint and trigger it.

What is the expected behavior?

The browser reloads after file changes that do not cause any actual errors.

If this is a feature request, what is motivation or use case for changing the behavior?

Please mention your webpack and Operating System version.

OS - Arch Linux
webpack - 2.2.1
webpack-dev-server - 2.3.0

Most helpful comment

@mnpenner https://github.com/MoOx/eslint-loader#emitwarning-default-false

{
  enforce: 'pre',
  exclude: /node_modules/,
  test: /\.jsx?$/,
  use: {
    loader: 'eslint-loader',
    options: {
      emitWarning: true, // @note: only for development
    },
  },
},

All 5 comments

I don't think this is a bug in webpack-dev-server. Apparently eslint-loader passes this eslint warning as an error (I think, haven't actually checked). As you can see here, it only shows that "Reload prevented" message when there is an actual compile error.

Nope I am just an idiot ... i had emitError set to true in the configuration, which was always emitting errors! Derp.

Closing.

@tquetano-r7 Where specifically did you have emitError? In .eslintrc.js or somewhere else?

I can't find that setting in either my webpack.config.js nor .eslintrc.js but this is the behaviour I'm observing.

@mnpenner https://github.com/MoOx/eslint-loader#emitwarning-default-false

{
  enforce: 'pre',
  exclude: /node_modules/,
  test: /\.jsx?$/,
  use: {
    loader: 'eslint-loader',
    options: {
      emitWarning: true, // @note: only for development
    },
  },
},

Errors while compiling. Reload prevented.

this is my error, i didn't install eslint-loader but this error occur what will i do?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tulika21-zz picture tulika21-zz  Â·  3Comments

mischkl picture mischkl  Â·  3Comments

antoinerousseau picture antoinerousseau  Â·  3Comments

piotrszaredko picture piotrszaredko  Â·  3Comments

mrdulin picture mrdulin  Â·  3Comments