question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to load config "react-app" to extend from.

See original GitHub issue

Hey, after upgrade to v7.0.0 I see those build errors: image

Tell us about your environment

  • ESLint Version: v7.0.0
  • Node Version: v13.14.0
  • npm Version: v13.14.0
  • react-scripts Version: v3.4.1

What parser (default, Babel-ESLint, etc.) are you using? The one react-scripts are using, default I guess.

Please show your full configuration:

Configuration
{
  "extends": ["react-app"],
  "plugins": [
    "react-hooks"
  ],
  "rules": {
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "no-use-before-define": [
      "error",
      {
        "functions": true,
        "classes": true,
        "variables": true
      }
    ]
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

It’s thrown from all components insde src.

  yarn eslint "src/**"

What did you expect to happen? Should do the checks as v. 6 did.

What actually happened? Please include the actual, raw output from ESLint.

./src/components/StandardDialogContent/StandardDialogContent.tsx
Failed to load config "react-app" to extend from.
Referenced from: /home/runner/work/emagine/emagine/.eslintrc

Are you willing to submit a pull request to fix this bug? Yeah, although I don’t know if it’s a eslint bug or intended behavior and instead CRA is the better place to fix this issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
mysticateacommented, May 15, 2020
npx create-react-app appy --template typescript
cd app
npm i eslint@latest
removed folder node_modules
remove yarn.lock
removed package.lock
removed eslint config entry in package.json
added in package.json new script "lint": "eslint "src/**""
added .eslintrc.js

That makes the error is the correct behavior. Because the app/package.json doesn’t have eslint-config-react-app, it means require("eslint-config-react-app") go to fail, but your .eslintrc.js depends on eslint-config-react-app.

In fact, the popular package managers have “dedupe” behavior, and the side-effect of the “dedupe” sometimes changed require(foo) for indirect dependencies, as a result, require("eslint-config-react-app") looks working accidentally.

In your case, installing the new eslint changed the “dedupe”'s side-effect, and you got the error. You need yarn add eslint-config-react-app and some peer deps to use it.

4reactions
ldrickcommented, May 14, 2020

I found the problem, I hope. And I confirm @bartlomiejzuber seeing eslint-config-react-app being under node_modules\react-scripts\node_modules.

This happens only if you use yarn for setup. npm brings eslint-config-react-app directly under node_modules.

I did:

npx create-react-app appy --template typescript cd app npm i eslint@latest removed folder node_modules remove yarn.lock removed package.lock removed eslint config entry in package.json added in package.json new script “lint”: “eslint "src/**"” added .eslintrc.js

module.exports = {
  root: true,
  extends: ['react-app'],
};

yarn yarn lint

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to load config "react" to extend from - Stack Overflow
First remove node modules and install node modules again. Then I had a issue while I run npm run build, I was getting...
Read more >
[eslint] failed to load config "react-app" to extend from - You.com
To solve your error message, you can simply remove the entry or replace it with a proper shared config (e.g. "eslint-config-airbnb" ). Make...
Read more >
Failed to load config "react-app" to extend from. - Code Grepper
failed to load config "react-app" to extend from. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On June 9,...
Read more >
If you get "Failed to load config "react-app" to extend from ...
Discussion on: Your First React GraphQL Frontend with the Apollo Client: A ... If you get "Failed to load config "react-app" to extend...
Read more >
Failed to load config "react-app" to extend from : r/learnreactjs
Failed to load config "react-app" to extend from ... So, I just updated my react-scripts to the latest version now I'm getting this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found