nrwl / nx

Smart Monorepos · Fast CI

Home Page:https://nx.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NX Failed to run migration-v18 from @angular/material. This workspace is NOT up to date!

bobKasbi opened this issue · comments

Current Behavior

After upgrading angualr version from 17.x to 18.x using following commands:

nx migrate latest
npx nx migrate --run-migrations

I keep receiving following error:
NX Failed to run migration-v18 from @angular/material. This workspace is NOT up to date!
NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Pass --verbose to see the stacktraces.
Command failed: npx nx _migrate --run-migrations
NX Command failed: npx nx migrate --run-migrations

Even if I run: nx reset and get this message:
NX Resetting the Nx cache and stopping the daemon.
NX Successfully reset the Nx workspace.

I get this message:
NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Pass --verbose to see the stacktraces.

Expected Behavior

The application should run and start without issues

GitHub Repo

No response

Steps to Reproduce

  1. To upgrade from Angular version 17.x to 18.x run following commands:
    nx migrate latest
  2. Run:
    npx nx migrate --run-migrations

Nx Report

NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Pass --verbose to see the stacktraces.

Command failed: /var/folders/tk/291d6pq907zdl84bn2q5yd9w0000gn/T/tmp-92817-SOxcgchQ6Xu9/node_modules/.bin/nx _migrate --run-migrations

Failure Logs

No response

Package Manager Version

10.1.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I use:

  1. Angular material
  2. esLint
  3. Cypress
  4. Jest
  5. NX Version: "19.4.2",
  6. TypeScript Version: "~5.2.2"

Hey :)

Can you provide a minimal reproduction? A small GitHub Repo that can reproduce the issue would be best, otherwise there are a number of variables that could impact our ability to reproduce and subsequently debug this issue for you.

Thanks for the feedback! I am aware that a small GitHub Repo could have helped to test and localize the issue. But I was not able to push the code to the Repo. In the other hand, I did localize and fix it myself just this morning. After couple of search and debugging, I found out there was a file .eslintrc.base.json missing/didn't exist, and I was trying to target it in the following file: .eslintrc.json under /cypress folder.

Code inside.eslintrc.json:
{ "ignorePatterns": ["!**/*"], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": {} }, { "files": ["*.ts", "*.tsx"], "rules": {} }, { "files": ["*.js", "*.jsx"], "rules": {} } ], "extends": ["plugin:cypress/recommended", "../.eslintrc.base.json"] }

The fix was just removing "../.eslintrc.base.json" from "extends": ["plugin:cypress/recommended", "../.eslintrc.base.json"]. So I ended up in: "extends": ["plugin:cypress/recommended"]

Actually the error message after migration is/was not really clear and helpful. It could have been easier to fix if the error message was more accurate! Thanks Guys for your feedback anyway!

Hey @bobKasbi! Great to hear you got your issue resolved.

As for the error messaging, we don't write the Angular Material migrations, so we wouldn't have been able to provide a better message unfortunately.

Glad this is resolved now for you though!