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.

Cannot load eslint plugin @nrwl/nx anymore after 12.8 -> 12.10 migrations (ESLint 8.0.0)

See original GitHub issue

Current Behavior

Nx Lint plugin can no longer be found after 12.10 upgrade and migrations were run.

Expected Behavior

Migration or documentation shows the new proper way to import the Nx eslint plugin

Steps to Reproduce

eslintrc.json

{
  "root": true,
  "ignorePatterns": ["**/*"],
  "plugins": ["@nrwl/nx", "jsx-a11y", "prettier", "testing-library", "import"],
...

package.json dev dependencies

  "devDependencies": {
    "@axe-core/react": "^4.2.1",
    "@babel/core": "7.15.8",
    "@babel/preset-env": "7.15.8",
    "@babel/preset-react": "7.14.5",
    "@babel/preset-typescript": "7.15.0",
    "@nrwl/cli": "12.10.0",
    "@nrwl/cypress": "12.10.0",
    "@nrwl/eslint-plugin-nx": "12.10.0",
    "@nrwl/jest": "12.10.0",
    "@nrwl/linter": "12.10.0",
    "@nrwl/react": "12.10.0",
    "@nrwl/storybook": "12.10.0",
    "@nrwl/tao": "12.10.0",
    "@nrwl/web": "12.10.0",
    "@nrwl/workspace": "12.10.0",
    "@storybook/addon-essentials": "~6.3.11",
    "@storybook/react": "~6.3.11",
    "@svgr/webpack": "^5.4.0",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "12.1.2",
    "@testing-library/user-event": "^13.3.0",
    "@types/jest": "27.0.2",
    "@types/node": "16.10.3",
    "@types/react": "17.0.29",
    "@types/react-dom": "17.0.9",
    "@types/react-router-dom": "5.3.1",
    "@types/uuid": "^8.3.1",
    "@typescript-eslint/eslint-plugin": "5.0.0",
    "@typescript-eslint/parser": "5.0.0",
    "babel-jest": "27.2.5",
    "babel-loader": "8.2.2",
    "canvas": "^2.8.0",
    "cypress": "^8.6.0",
    "dotenv": "10.0.0",
    "eslint": "8.0.0",
    "eslint-config-prettier": "8.3.0",
    "eslint-plugin-cypress": "^2.10.3",
    "eslint-plugin-import": "^2.25.1",
    "eslint-plugin-jsx-a11y": "6.4.1",
    "eslint-plugin-prettier": "^4.0.0",
    "eslint-plugin-react": "7.26.1",
    "eslint-plugin-react-hooks": "4.2.0",
    "eslint-plugin-testing-library": "^4.9.1",
    "jest": "27.2.5",
    "jest-junit": "^13.0.0",
    "prettier": "^2.3.1",
    "ts-jest": "27.0.5",
    "ts-node": "~10.3.0",
    "typescript": "~4.4.2",
    "url-loader": "^4.1.1"
  },

Failure Logs

yarn lint --verbose
yarn run v1.22.11
$ nx workspace-lint && nx lint --verbose

> nx run customer-portal-frontend:lint --verbose 

Linting "customer-portal-frontend"...
Failed to load plugin '@nrwl/nx' declared in 'apps/customer-portal-frontend/.eslintrc.json': Class extends value undefined is not a constructor or null
Referenced from: /home/username/Documents/comp-portals-frontend/apps/customer-portal-frontend/.eslintrc.json
TypeError: Failed to load plugin '@nrwl/nx' declared in 'apps/customer-portal-frontend/.eslintrc.json': Class extends value undefined is not a constructor or null
Referenced from: /home/username/Documents/comp-portals-frontend/apps/customer-portal-frontend/.eslintrc.json
    at Object.<anonymous> (/home/username/Documents/comp-portals-frontend/node_modules/@nrwl/eslint-plugin-nx/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/CLIEngine.js:12:34)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/username/Documents/comp-portals-frontend/node_modules/@nrwl/eslint-plugin-nx/node_modules/@typescript-eslint/experimental-utils/dist/ts-eslint/index.js:14:14)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”

>  NX   ERROR  Running target "customer-portal-frontend:lint" failed

  Failed tasks:
  
  - customer-portal-frontend:lint
  
  Hint: run the command with --verbose for more details.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  NX  Report complete - copy this into the issue template

  Node : 16.10.0
  OS   : linux x64
  yarn : 1.22.11
  
  nx : 12.10.0
  @nrwl/angular : Not Found
  @nrwl/cli : 12.10.0
  @nrwl/cypress : 12.10.0
  @nrwl/devkit : 12.10.0
  @nrwl/eslint-plugin-nx : 12.10.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.10.0
  @nrwl/linter : 12.10.0
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : Not Found
  @nrwl/react : 12.10.0
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.10.0
  @nrwl/web : 12.10.0
  @nrwl/workspace : 12.10.0
  @nrwl/storybook : 12.10.0
  @nrwl/gatsby : Not Found
  typescript : 4.4.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
meeroslavcommented, Oct 19, 2021

@KevinVandy eslint v8 is not yet supported by Nx as we are waiting for some issues with supported frameworks to be resolved. Please use 7.x in the meantime.

Once we have a support for v8 in place we will also provide an automated migration. If you upgrade packages on your own, things might still work but they can also break (like it happened to you).

1reaction
drkstr101commented, Oct 20, 2021

@KevinVandy eslint v8 is not yet supported by Nx as we are waiting for some issues with supported frameworks to be resolved. Please use 7.x in the meantime.

Once we have support for v8 in place we will also provide an automated migration. If you upgrade packages on your own, things might still work but they can also break (like it happened to you).

Yes indeed, my mistake. One of the first things I did was to `yarn set version berry && yarn plugin import interactive-tools, then upgraded everything to latest. My expectation at the time was to expect potential breaking changes, only I forgot all about this until just now. Whoops!

Cheers and thank you for the reply!

Read more comments on GitHub >

github_iconTop Results From Across the Web

@nrwl/eslint-plugin-nx - npm
Nx is a next generation build system with first class monorepo support and powerful integrations. This package is an ESLint plugin for Nx....
Read more >
ESLint: TypeError: Error while loading rule '@nrwl/nx/enforce ...
When opening any .ts (Typescript) file in a project on Angular 11 I get an ESLint error. There was no such error before,...
Read more >
@nrwl/linter:eslint | Nx
Linter can be configured in multiple ways. The basic way is to provide only lintFilePatterns , which is a mandatory property. This tells...
Read more >
The ultimate migration guide to angular-eslint, ESLint and Nx 11
json configuration should mention the @nrwl/nx/typescript ESLint plugin. Open the .eslintrc.json files in the Angular application and libraryΒ ...
Read more >
Definition for rule '@nrwl/nx/nx-plugin-checks' was not found
Using NX v14.1.4, I'm trying to run linting on a lib that contains a custom executor and I get this error. My config...
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