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.

eslint-config-react-app is not compatible with ESLint 8

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:47
  • Comments:17

github_iconTop GitHub Comments

34reactions
Avasamcommented, Nov 6, 2021

Temporary workaround: npm i eslint-plugin-flowtype@latest eslint-plugin-import@latest eslint-plugin-react-hooks@next --force --save-dev

16reactions
instantlinuxcommented, Feb 16, 2022

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:

  "dependencies": {
    "eslint-config-react-app": "^7.0.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "worker-loader": "^3.0.8"
  },
  "devDependencies": {
    "@babel/cli": "^7.17.0",
    "@babel/core": "^7.17.2",
    "@babel/plugin-proposal-private-property-in-object": "^7.16.7",
    "@babel/preset-env": "^7.16.11",
    "@babel/preset-react": "^7.16.7",
    "babel-eslint": "^10.1.0",
    "eslint": "^8.9.0",
    "eslint-plugin-react": "^7.28.0",
    "jest-junit": "^12.0.0",
    "react-scripts": "^5.0.0"
  },

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-config-react-app - npm
Start using eslint-config-react-app in your project by running `npm i ... ESLint configuration in a project not built with Create React App, ...
Read more >
My create-react-app is failing to compile due to ESLint error
This issue has been fixed in the react-scipts:"4.0.3" but, the eslint errors present in the project are not converted to warnings by default....
Read more >
Eslint-config-react-app - npm.io
If you want to use this ESLint configuration in a project not built with Create React App, you can install it with the...
Read more >
eslint-config-react-app | Yarn - Package Manager
eslint-config -react-app ... ESLint configuration used by Create React App ... App 5.0.1 is a maintenance release that improves compatibility with React 18....
Read more >
eslint-config-react-app - npm package - Snyk
Learn more about eslint-config-react-app: package health score, popularity, security, ... Latest version published 8 months ago ... No known security issues.
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