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

eslint-plugin-import error After Upgrade Eslint 8.0.0 #15148

Closed
1 task
miladezzat opened this issue Oct 10, 2021 · 9 comments
Closed
1 task

eslint-plugin-import error After Upgrade Eslint 8.0.0 #15148

miladezzat opened this issue Oct 10, 2021 · 9 comments
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects

Comments

@miladezzat
Copy link

Environment

Environment Info:

Node version: v14.17.6
npm version: v8.0.0
Local ESLint version: v8.0.0 (Currently used)
Global ESLint version: v8.0.0
Operating System: linux 5.13.19-200.fc34.x86_64

Oops! Something went wrong! :(

ESLint: 8.0.0

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/glob-util' is not defined by "exports" in /home/milad/Desktop/sakneen/sakneen-api/node_modules/eslint/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
    at resolveExports (internal/modules/cjs/loader.js:449:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (/home/milad/Desktop/sakneen/sakneen-api/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/milad/Desktop/sakneen/sakneen-api/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js:43:34)
    at Module._compile (/home/milad/Desktop/sakneen/sakneen-api/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

What parser are you using?

Default (Espree)

What did you do?

Configuration
<!-- Paste your configuration here -->
<!-- Paste your code here -->

What did you expect to happen?

no

What actually happened?

Oops! Something went wrong! :(

ESLint: 8.0.0

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/util/glob-util' is not defined by "exports" in /home/milad/Desktop/sakneen/sakneen-api/node_modules/eslint/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
at resolveExports (internal/modules/cjs/loader.js:449:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (/home/milad/Desktop/sakneen/sakneen-api/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object. (/home/milad/Desktop/sakneen/sakneen-api/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js:43:34)
at Module._compile (/home/milad/Desktop/sakneen/sakneen-api/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@miladezzat miladezzat added bug ESLint is working incorrectly repro:needed labels Oct 10, 2021
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Oct 10, 2021
@ljharb
Copy link
Sponsor Contributor

ljharb commented Oct 10, 2021

If you’d used npm 7+ to install it, it would have warned you that eslint 8 and eslint-plugin-import aren’t compatible yet.

@aladdin-add aladdin-add added the 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser label Oct 11, 2021
@aurelien-reeves
Copy link

We encounter the same issue with @cucumber/cucumber-expressions: cucumber/cucumber-expressions#29

@ljharb what do you mean? I cannot find any warning in the GHA logs. I have tried myself to install eslint using npm 7 and 8 and showed no warning of any kind.

$ npm --version
8.0.0

$ npm i -D eslint

added 77 packages, and audited 172 packages in 1s

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

@miladezzat
Copy link
Author

This occurred with airbnb

    "eslint": "^8.0.0",
    "eslint-config-airbnb-base": "^14.2.1",
    "eslint-plugin-import": "^2.24.2",

@aurelien-reeves

@ljharb
Copy link
Sponsor Contributor

ljharb commented Oct 11, 2021

@aurelien-reeves mybe npm has a bug.

Run npm ls. If it exits nonzero, your dep graph is invalid and you can’t expect anything to work.

‘eslint-plugin-import`, as well as the Airbnb config, do not yet support eslint 8. You must stay on eslint 7 for the time being.

@kimbaudi
Copy link

I'm getting the same error message as the OP and a bunch of warnings after upgrading to eslint 8.

warning " > eslint-config-airbnb@18.2.1" has incorrect peer dependency "eslint@^5.16.0 || ^6.8.0 || ^7.2.0".
warning "eslint-config-airbnb > eslint-config-airbnb-base@14.2.1" has incorrect peer dependency "eslint@^5.16.0 || ^6.8.0 || ^7.2.0".
warning " > eslint-config-airbnb-typescript@14.0.1" has incorrect peer dependency "@typescript-eslint/eslint-plugin@^4.29.3".
warning " > eslint-config-airbnb-typescript@14.0.1" has incorrect peer dependency "@typescript-eslint/parser@^4.29.3".
warning " > eslint-plugin-import@2.24.2" has incorrect peer dependency "eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0".
warning " > eslint-plugin-jsx-a11y@6.4.1" has incorrect peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".
warning " > eslint-plugin-react@7.26.1" has incorrect peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".
warning " > eslint-plugin-react-hooks@4.2.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0".

I guess I need to wait for all these packages to support eslint 8 before I can upgrade.

@ljharb
Copy link
Sponsor Contributor

ljharb commented Oct 11, 2021

Yep, every time anything that has a plugin system bumps a major (eslint, babel, typescript, react, etc), you always have to wait until the plugin ecosystem catches up.

That's just part of the tradeoffs that must be made when one combines "a plugin system" with "breaking changes".

@nzakas nzakas changed the title After Upgrade Eslint 8.0.0 eslint-plugin-import After Upgrade Eslint 8.0.0 Oct 12, 2021
@nzakas nzakas changed the title eslint-plugin-import After Upgrade Eslint 8.0.0 eslint-plugin-import error After Upgrade Eslint 8.0.0 Oct 12, 2021
@nzakas nzakas removed bug ESLint is working incorrectly repro:needed labels Oct 12, 2021
@nzakas
Copy link
Member

nzakas commented Oct 12, 2021

What @ljharb said. :)

We will leave this open for visibility but there is nothing for the ESLint team to do here.

@nzakas nzakas moved this from Needs Triage to Blocked in Triage Oct 12, 2021
@ljharb
Copy link
Sponsor Contributor

ljharb commented Oct 12, 2021

I've just released v2.25.1 of eslint-plugin-import, which should resolve at least one of the issues. Please follow airbnb/javascript#2478 for updates for the airbnb config, which encompasses a significant majority of the eslint ecosystem.

@miladezzat
Copy link
Author

Solved

Triage automation moved this from Blocked to Complete Oct 14, 2021
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Apr 13, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

6 participants