react-redux-universal-hot-example icon indicating copy to clipboard operation
react-redux-universal-hot-example copied to clipboard

Annoying eslint error screen

Open berdof opened this issue 9 years ago • 13 comments

During development i constantly having these messages http://take.ms/vksE2 . Is there any way to disable red error screen in the browser window but to stay it working in console?

berdof avatar Dec 31 '15 10:12 berdof

@berdof those are linting errors. I'm not entirely sure how they hook into the setup (perhaps with redbox-react, which is enabled here: https://github.com/erikras/react-redux-universal-hot-example/blob/master/.babelrc#L19) ... you can also turn off linting in webpack altogether by removing eslint-loader here: https://github.com/erikras/react-redux-universal-hot-example/blob/master/webpack/dev.config.js#L67

bdefore avatar Dec 31 '15 23:12 bdefore

See #170 , remove eslint-loader from dev.config.js jsx loader.

asaf avatar Jan 03 '16 22:01 asaf

@asaf , you made my day! Thanks!

berdof avatar Jan 04 '16 15:01 berdof

Any suggestions on how to keep the eslint-loader, but remove redbox? I've been messing with .babelrc and uninstalled redox w/ npm, but it still shows up

rickyPanzer avatar Feb 26 '16 18:02 rickyPanzer

Just add the option emitWarning=true in eslint-loader in the webpack configuration (https://github.com/erikras/react-redux-universal-hot-example/blob/master/webpack/dev.config.js#L83).

The loader becomes: eslint-loader?emitWarning=true. Then, the lint errors will only be shown in the console of your browser.

Anomen avatar Mar 12 '16 04:03 Anomen

Hey, just retouching the topic. It's annoying to see eslint errors while development. I am seeing eslint errors in the terminal console each time webpack tries to builds. https://github.com/erikras/react-redux-universal-hot-example/blob/master/webpack/dev.config.js#L83

How to remove while development.

aseem2625 avatar Sep 23 '16 07:09 aseem2625

@rickyPanzer don't know if you already figured it out but: That option is set within the webpack-hot-middleware options.

server.use(hotMiddleware(compiler, {
  overlay: false
}));

worked for me. Thanks!

coreylight avatar Nov 21 '16 17:11 coreylight

@coreylight that didn't work for me unfortunately :(

jgentes avatar Dec 07 '16 20:12 jgentes

@jgentes Indeed I actually figured out the real solution which is adding a flag onto the webpack-hot-middleware entry item in my webpack config.

webpack.config

  cache: true,
  context: context_dir,
  devtool: isProd ? 'hidden-source-map' : 'inline-soure-map',
  node: {
    fs: 'empty',
    net: 'empty',
    tls: 'empty'
  },
  entry: {
    'index': _.compact([
      !isProd && 'react-hot-loader/patch',
      !isProd && 'webpack-hot-middleware/client?overlay=false',
      './index.jsx'
    ]),
  },
  output: {
    path: path.join(__dirname, "dist"),
    publicPath: '/',
    filename: `[name].[hash].js`
  },

coreylight avatar Dec 07 '16 20:12 coreylight

Thanks, I'll give that a shot.. unfortunately can't reproduce the problem to test it right now.

jgentes avatar Dec 08 '16 17:12 jgentes

I can fix it using options for eslint-loader:

  ...
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        enforce: 'pre',
        use: [{ loader: 'eslint-loader', options: { emitWarning: true } }],
        exclude: /node_modules/,
      },
  ...

evserykh avatar Feb 09 '17 06:02 evserykh

@evserykh Did it disabled the overlay or enabled it?

Anybody know how to turn this on, because I installed and no overlay error :(

rizkiandrianto avatar Mar 07 '17 13:03 rizkiandrianto

@rizkiandrianto I guess you have two options:

  1. webpack-hot-middleware/client?overlay=false - it will disable eslint's errors overlay and you won't see it anymore or
  2. use: [{ loader: 'eslint-loader', options: { emitWarning: true } }] - make eslint generating warnings instead of errors (as I understood overlay is visible when there are errors only)

If you want to see errors overlay just use default settings webpack-hot-middleware/client with use: [{ loader: 'eslint-loader' }]

evserykh avatar Mar 07 '17 14:03 evserykh