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

Trying to run yarn build fails because of eslint webpack loader #306

Closed
thezanke opened this issue Jan 19, 2017 · 2 comments
Closed

Trying to run yarn build fails because of eslint webpack loader #306

thezanke opened this issue Jan 19, 2017 · 2 comments

Comments

@thezanke
Copy link
Contributor

thezanke commented Jan 19, 2017

When I try to run yarn build I get the following:

🐵  Sagui Setting NODE_ENV=development
🐵  Sagui Build failed.
(undefined) Loader /path/to/project/node_modules/sagui/node_modules/eslint/lib/api.js didn't return a function
error Command failed with exit code 1.

This is due to a bug in the webpack loader only using "eslint" instead of "eslint-loader". To patch this locally in my project I added the following to my sagui.config.js:

module.exports = {
  ...
  webpack: {
    module: {
      preLoaders: [
        {
          test: /\.(jsx?|es6)$/,
          loader: 'eslint-loader',
          exclude: /node_modules/
        }
      ]
    }
  }
}

More info on bug here, as well as other sources findable through Google.

@thezanke
Copy link
Contributor Author

It's worth mentioning, for reproducibility, that I am using the "react-app" eslint config. Here's my .eslintrc:

{
  "extends": "react-app"
}

This required a peerDependency of eslint@^3.8.1 which I then added as a devDependency. Only once I add the eslint package does the problem occur.

pirelenito added a commit that referenced this issue Jan 21, 2017
Explicitly specify eslint-loader in webpack presets (Fixes #306)
@urrvesh
Copy link

urrvesh commented Sep 11, 2019

Please install eslint-loader using npm i eslint-loader or yarn add eslint-loader

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

2 participants