Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

ESLint loader breaks devtool options in webpack #227

Closed
marharyta opened this issue May 1, 2018 · 2 comments
Closed

ESLint loader breaks devtool options in webpack #227

marharyta opened this issue May 1, 2018 · 2 comments

Comments

@marharyta
Copy link

After searching around a lot, I came to realization that eslint-loader in webpack breaks source map output.
If I use eslint in my webpack file as a loader for .js, this is the output that I get in chrome devtools when I make an error:
screen shot 2018-05-01 at 16 54 31
The error is shown in a bundles file.
My webpack config looks like this:
module: {

    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [
          { loader: 'babel-loader' },
          {
            loader: 'eslint-loader',
            options: { formatter: require('eslint/lib/formatters/stylish') }
          }
        ]
      }
    ]
  },

If I delete eslint loader from the config, them my output in the console is correct and the error is shown in the right place:
screen shot 2018-05-01 at 18 04 42

My webpack config looks like:

module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [{ loader: 'babel-loader' }]
      }
    ]
  },

I believe it is a bug, so this might need further investigation.
I used:
"webpack": "^4.6.0",
"webpack-cli": "^2.0.13",
"webpack-dev-server": "^3.1.3"
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^2.0.0",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.7.0",

Chrome Version 66.0.3359.139 (Official Build) (64-bit)

You can find more explanation of this error in a StackOverflow question here: https://stackoverflow.com/questions/50105741/webpack-4-devtool-option-does-not-work-with-webpack-dev-server

and a description of my experience here:
https://medium.com/p/79fb676417f4/edit

@nothingismagick
Copy link

I can confirm a similar experience. Thanks for the detailed write-up! I have also noticed a very strange warning during a yarn install, not sure if it is related:

warning " > eslint-loader@2.0.0" has unmet peer dependency "webpack@>=2.0.0 <5.0.0".

@Mykybo
Copy link

Mykybo commented Mar 19, 2019

I just run into this as well. This is pretty important, why are you ignoring this issue? :(

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

No branches or pull requests

4 participants