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

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'unicorn #93

Closed
marckraw opened this issue Dec 9, 2021 · 6 comments
Closed

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'unicorn #93

marckraw opened this issue Dec 9, 2021 · 6 comments

Comments

@marckraw
Copy link

marckraw commented Dec 9, 2021

hey hey, after making my annual upgrade of deps, i foung out that error when using

ESLint: 8.4.1,
eslint-config-oclif: 4.0.0

using node 16.13.1

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'unicorn' declared in '@sb-mig/sb-mig/.eslintrc » eslint-config-oclif': Package subpath './lib/rules/no-warning-comments' is not defined by "exports" in /Users/marckraw/Projects/Private/__sb-mig/sb-mig/node_modules/eslint/package.json
Referenced from: /Users/marckraw/Projects/Private/__sb-mig/sb-mig/node_modules/eslint-config-oclif/index.js
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:440:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:692:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (/Users/marckraw/Projects/Private/__sb-mig/sb-mig/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/marckraw/Projects/Private/__sb-mig/sb-mig/node_modules/eslint-plugin-unicorn/rules/expiring-todo-comments.js:5:18)

Let me know, what else information you will need to take a look at that problem :)

@marckraw
Copy link
Author

marckraw commented Dec 9, 2021

Is it something related to esmodules maybe ?

@Kritten
Copy link

Kritten commented Jan 10, 2022

I get the exact same error with Node version v14.15.4 and Eslint on v.8.6.0

@felipecrs
Copy link

Also receiving this problem.

@0xBC84
Copy link

0xBC84 commented Mar 8, 2022

This was fixed in a later version of unicorn. I had to pin the version in package.json:

"resolutions": {
  "eslint-plugin-unicorn": "^41.0.0"
}

@mikaelkaron
Copy link

This was fixed in a later version of unicorn. I had to pin the version in package.json:

"resolutions": {
  "eslint-plugin-unicorn": "^41.0.0"
}

Same if you are using npm:

  "overrides": {
    "eslint-plugin-unicorn": "^41.0.0"
  }

4ydx added a commit to autifyhq/autify-cli that referenced this issue Mar 10, 2023
Linting failures required updates of their own:

1.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'unicorn' declared in '.eslintrc » eslint-config-oclif':
Package subpath './lib/rules/no-warning-comments' is not defined by "exports" in /.../node_modules/eslint/package.json

Fix:

oclif/eslint-config-oclif#93

"overrides": {
  "eslint-plugin-unicorn": "^41.0.0",
}

2. As a result of the override above

Bug: (TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.json':
Class extends value undefined is not a constructor or null)

Fix:

eslint/eslint#15149

"overrides": {
  "eslint-plugin-unicorn": "^41.0.0",
  "@typescript-eslint/parser": "^5.0.0",
  "@typescript-eslint/eslint-plugin": "^5.0.0"
},
4ydx added a commit to autifyhq/autify-cli that referenced this issue Mar 10, 2023
Linting failures required updates of their own:

1.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Failed to load plugin 'unicorn' declared in '.eslintrc » eslint-config-oclif':
Package subpath './lib/rules/no-warning-comments' is not defined by "exports" in /.../node_modules/eslint/package.json

Fix:

oclif/eslint-config-oclif#93

"overrides": {
  "eslint-plugin-unicorn": "^41.0.0",
}

2. As a result of the override above

Bug: (TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.json':
Class extends value undefined is not a constructor or null)

Fix:

eslint/eslint#15149

"overrides": {
  "eslint-plugin-unicorn": "^41.0.0",
  "@typescript-eslint/parser": "^5.0.0",
  "@typescript-eslint/eslint-plugin": "^5.0.0"
},
@mdonnalley
Copy link
Contributor

Going to close this since it seems like this has been resolved in eslint-plugin-unicorn

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

No branches or pull requests

6 participants