Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] in version 5.0.0 react eslint plugins #11759

Open
MahmoodIRAKE opened this issue Dec 15, 2021 · 16 comments
Open

[BUG] in version 5.0.0 react eslint plugins #11759

MahmoodIRAKE opened this issue Dec 15, 2021 · 16 comments

Comments

@MahmoodIRAKE
Copy link

Describe the bug

Once i do create my app and without changing anything the first error i get is react plugin confliction
i will paste the error here
ERROR in Plugin "react" was conflicted between "package.json » eslint-config-react-app » C:\Users\user\desktop\mkd\my-app\node_modules\eslint-config-react-app\base.js" and "BaseConfig » C:\Users\user\Desktop\mkd\my-app\node_modules\eslint-config-react-app\base.js".
and then if i ignore this one i get the error of that i can not do import from outside package

Did you try recovering your dependencies?

(Write your answer here.)
Yes i tried few times
and i think the error is in the react scripts
so that why i found two main solutions

  1. removed the eslint-config-react-app
  2. down graded the react-script to 4.0.3

Which terms did you search for in User Guide?

(Write your answer here if relevant.)
Almost find nothing that why i think that this is a bug

Environment

(paste the output of the command here.)
$ npx create-react-app --info

Environment Info:

current version of create-react-app: 5.0.0
running from C:\Users\user\AppData\Roaming\npm\node_modules\create-react-app

System:
OS: Windows 10 10.0.19043
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
Binaries:
Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: Not Found
Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.53)
Internet Explorer: 11.0.19041.1202
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

Steps to reproduce

(Write your steps here:)

1.npx create react app
2. npm start
3.the error

Expected behavior

(Write what you thought would happen.)
openning project without error
installing outside package and run it and import it without any problem

Actual behavior

(Write what happened. Please add screenshots!)
the react app should start noramlly but the app start with confliction error in plugins react
although when installing another package no import can be done

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

@MahmoodIRAKE
Copy link
Author

i think removing the eslint-config-react-app fixed the confliction issue
removing the from package json
and delting node modules
and installing again fix the problem

@MahmoodIRAKE
Copy link
Author

Although this might
fix this issue Too
#11756 (comment)

@deanolium
Copy link

I'm also getting this with Yarn 3.1.1. If I don't add eslint-config-react-app to the dependencies, then it will complain with:

Error in Failed to load config "react-app" to extend from

This is despite this being a dependency of create-react-app. If you add this package manually, then it will cause this conflict as from yarn's point of view, there are two packages with the same name. Looking at .pnp.cjs it will list this twice, showing it has pulled the zip twice.

Beyond pulling out react-app from my eslint config (which is non-ideal), I'm not really sure how to resolve this.

@deanolium
Copy link

Looking into the codebase, it looks like the issue, once you've installed eslint-config-react-app manually, is that the eslint config is being setup with webpack. So that suggests that we can just rip out the lines in package.json loading react-app. However, I'm not sure if this will effect eslint within vscode (since that should be reading the eslint config from either package.json or .eslintrc.json, without going through webpack).

A solution to this is you can stop webpack from running eslint by seeing the environment variable DISABLE_ESLINT_PLUGIN to true. Though I'm not sure what repercussions this will have.

@neillindberg
Copy link

neillindberg commented Dec 17, 2021

Possible answer: In upgrading from 4 to 5 I found I had to update the package "eslint-plugin-testing-library" to just get the app running.

However, I'm here looking for how to overcome all these warnings now that the app is running. They all have:
Failed to parse source map from... To list just a few graphql-request, react-double-scrollbar, @datapunt/matomo-tracker-react. I hope whatever is causing this is soon resolved.

@mrssnow
Copy link

mrssnow commented Dec 17, 2021

Same issue - I notice the cases are different between desktop and Desktop - maybe it's trying to be case specific.

@MahmoodIRAKE
Copy link
Author

@mrssnow hi not i did the reaserch about that an no
i think the main problem as @deanolium said .
the solution that i did worked fro me fine .comment 1 &2
others just downgraded the create react app to 4.0.3

@mrssnow
Copy link

mrssnow commented Dec 19, 2021

But I didn't install anything manually and got the same issue. Either way, shouldn't have to downgrade React to fix a problem.

@terriadsit
Copy link

I had the same issue but was able to resolve it using mrssnow's comment regarding case sensitivity. I too had used a lowercase d instead of an uppercase D in my directory path.

@deanolium
Copy link

One temporary solution for people using yarn 2/3's pnp, you can open .pnp.cjs and then search for the eslint-config-react-app's package locations and then make sure they all just point to one of them. Really non-ideal, but it resolves the issue for now.

@eakl
Copy link

eakl commented Jan 10, 2022

I'm also getting this with Yarn 3.1.1. If I don't add eslint-config-react-app to the dependencies, then it will complain with:

Error in Failed to load config "react-app" to extend from

This is despite this being a dependency of create-react-app. If you add this package manually, then it will cause this conflict as from yarn's point of view, there are two packages with the same name. Looking at .pnp.cjs it will list this twice, showing it has pulled the zip twice.

Beyond pulling out react-app from my eslint config (which is non-ideal), I'm not really sure how to resolve this.

Removing the duplicate package from yarn.lockfixed the issue for now. Not ideal but it worked

@terriadsit
Copy link

terriadsit commented Jan 10, 2022 via email

@nmoinvaz
Copy link

nmoinvaz commented Mar 2, 2022

I experienced this same issue and resolved it by removing this from my package.json:

eslintConfig: {
  "extends": "react-app"
}

I was trying to configure also in my .eslintrc.json, so I suppose it was complaining about it being configured in two places.

@nmoinvaz
Copy link

nmoinvaz commented Mar 4, 2022

Scratch that, it resolved it for me locally, but it did not resolve it for a coworker. In the end I just removed eslint-plugin-import from my package.json and allowed eslint-config-react-app to import eslint-plugin-import. By doing so I could no longer extend plugin:import/recommended so I ended up copying the few recommended settings from https://github.com/import-js/eslint-plugin-import/blob/main/config/recommended.js into my .eslintrc.json.

RobertoSnap added a commit to BROKLab/brok-monorepo that referenced this issue May 16, 2022
@jlebovic
Copy link

been experiencing the same error. After trying a few different tactics seen here, mrssnow's solution about making sure both directory paths have the same things capitalized or lowercased fixed it for me.

@marceloOrigoni
Copy link

marceloOrigoni commented May 10, 2023

I encountered this issue today, after trying to upgrade from 4.0.3 to 5.0.0, after some research, checking the node_modules folder and seeing the differences with a freshly created React App, I got to the conclusion that v4.0.3 had eslint-loader as a dependency and v5.0.0 did not. I removed it, run npm i, and the build script worked like a charm.

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

No branches or pull requests

9 participants