create-react-app: eslint-config-react-app is not compatible with ESLint 8
Describe the bug
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/rules/no-unused-expressions' is not defined by "exports" in /xxx/node_modules/eslint/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
at resolveExports (internal/modules/cjs/loader.js:437:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:477:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)
at Function.Module._load (internal/modules/cjs/loader.js:730:27)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (/xxx/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (/xxx/node_modules/eslint-plugin-flowtype/dist/rules/noUnusedExpressions.js:8:51)
at Module._compile (/xxx/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
Looks like eslint-plugin-flowtype/dist/rules/noUnusedExpressions.js
imports file that’s not exported explicitly.
Environment
Eslint 8.0.0 eslint-plugin-flowtype: 6.1.0 eslint-config-react-app: 6.0.0
Expected behavior
No errors
Actual behavior
Error from the above
Reproducible demo
Clone https://github.com/ringcentral/ringcentral-javascript/tree/eslint8 (branch eslint8)
yarn install
yarn test
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 49
- Comments: 19
Commits related to this issue
- pc - test coverage, and a fix to problem deploying on Heroku Heroku deploy was erroring with: Failed to load plugin 'flowtype' declared in '.eslintrc.json » eslint-config-react-app': Cannot find modu... — committed to ucsb-cs156-w22/demo-spring-react-example-v2 by pconrad 2 years ago
- pc - test coverage, and a fix to problem deploying on Heroku Heroku deploy was erroring with: Failed to load plugin 'flowtype' declared in '.eslintrc.json » eslint-config-react-app': Cannot find modu... — committed to ucsb-cs156-w22/demo-spring-react-example-v2 by pconrad 2 years ago
- pc - test coverage, and a fix to problem deploying on Heroku Heroku deploy was erroring with: Failed to load plugin 'flowtype' declared in '.eslintrc.json » eslint-config-react-app': Cannot find modu... — committed to ucsb-cs156-w22/demo-spring-react-example-v2 by pconrad 2 years ago
- pc - test coverage, and a fix to problem deploying on Heroku Heroku deploy was erroring with: Failed to load plugin 'flowtype' declared in '.eslintrc.json » eslint-config-react-app': Cannot find modu... — committed to ucsb-cs156-w22/demo-spring-react-example-v2 by pconrad 2 years ago
Temporary workaround:
npm i eslint-plugin-flowtype@latest eslint-plugin-import@latest eslint-plugin-react-hooks@next --force --save-dev
Spent a few more hours on this, it’s really impossible to come up with a working
package.json
. This is what I want to have working:The number of permutations I’ve tried with different versions is about 50, and it’s just way too much of a headache iterating on a simple issue like dependency updates. How do we get attention paid to this nightmare we face as react developers?
Any update on the issue ? Still having errors
Looks like the issue has been fixed.
I just did
yarn add -D eslint-plugin-flowtype@latest
and that did the trickTemporary workaround for yarn:
yarn add eslint-plugin-flowtype@latest eslint-plugin-import@latest eslint-plugin-react-hooks@next --force -D
It is still happening for me… and none of the fixes above are working.
thanks @Avasam that did the trick
It would be great to have this support in the upcoming v5.
Nice. Figured I search for eslint before posting an issue to tell that eslint-config-react-app is not providing a new-config-file-format-compatible configuration for eslint. Found 197 open issues with ‘eslint’. Half of them stale. At least 3 issues about the incompatibility, one of them also stale. React truly is the best framework in the world (I’m german and that was sarcasm)
Why not back off eslint-config-react-app back to 7.x of eslint in the released version until 8.x is able to be integrated? It makes doing upgrades a bit of a mess. Just a suggestion.
Same behavior here!
Eslint 8.0.0 eslint-plugin-flowtype: 6.1.0 eslint-config-react-app: 6.0.0
For me, I ended up needing to do this in Package.json:
Probably would be better to scope those overrides, but I’m not too worried since these are just for linting.
Here is a dirty fix that you can use with
patch-package
: