nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.69k stars 2.27k forks source link

Cannot find configuration for task when upgrading to 19.1.0-beta.5 and Angular 18 #26002

Open jinder opened 1 month ago

jinder commented 1 month ago

Current Behavior

When running migrations after upgrading from NX 19.0.4 and Angular 17.3.7 to NX 19.1.0-beta.5 and Angular 18 following error occurs:

Error: Cannot find configuration for task nexus-app:true
    at ProcessTasks.createTask (C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\create-task-graph.js:156:19)
    at ProcessTasks.processTasks (C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\create-task-graph.js:23:39)
    at createTaskGraph (C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\create-task-graph.js:194:21)
    at createTaskGraphAndValidateCycles (C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\run-command.js:62:63)
    at C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\run-command.js:86:27
    at handleErrors (C:\Projects\nexus\nexus\node_modules\nx\src\utils\params.js:10:22)
    at runCommand (C:\Projects\nexus\nexus\node_modules\nx\src\tasks-runner\run-command.js:83:52)
    at Object.runOne (C:\Projects\nexus\nexus\node_modules\nx\src\command-line\run\run-one.js:53:59)
    at async handleErrors (C:\Projects\nexus\nexus\node_modules\nx\src\utils\params.js:10:16)
    at async Object.handler (C:\Projects\nexus\nexus\node_modules\nx\src\command-line\run\command-object.js:28:9)

Expected Behavior

Should run migrations without error.

GitHub Repo

No response

Steps to Reproduce

  1. Starting version NX 19.0.4 and Angular 17.3.7
  2. nx migrate 19.1.0-beta.5
  3. npm install
  4. nx --run-migrations

Nx Report

Node   : 20.13.1
OS     : win32-x64
npm    : 10.5.2

nx                 : 19.1.0-beta.5
@nx/js             : 19.1.0-beta.5
@nx/jest           : 19.1.0-beta.5
@nx/linter         : 19.1.0-beta.5
@nx/eslint         : 19.1.0-beta.5
@nx/workspace      : 19.1.0-beta.5
@nx/angular        : 19.1.0-beta.5
@nx/cypress        : 19.1.0-beta.5
@nx/devkit         : 19.1.0-beta.5
@nx/eslint-plugin  : 19.1.0-beta.5
@nx/storybook      : 19.1.0-beta.5
@nrwl/tao          : 19.1.0-beta.5
@nx/web            : 19.1.0-beta.5
@nx/webpack        : 19.1.0-beta.5
typescript         : 5.3.3
---------------------------------------
Community plugins:
@ngrx/component       : 17.2.0
@ngrx/component-store : 17.2.0
@ngrx/effects         : 17.2.0
@ngrx/router-store    : 17.2.0
@ngrx/store           : 17.2.0
@ngrx/store-devtools  : 17.2.0
@storybook/angular    : 8.1.1
nx-stylelint          : 17.1.4

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

Migrations file:

{
  "migrations": [
    {
      "cli": "nx",
      "version": "19.1.0-beta.2",
      "requires": {
        "@angular/core": ">=18.0.0"
      },
      "description": "Update the @angular/cli package version to ~18.0.0.",
      "factory": "./src/migrations/update-19-1-0/update-angular-cli",
      "package": "@nx/angular",
      "name": "update-angular-cli-version-18-0-0"
    },
    {
      "version": "18.0.0",
      "description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
      "factory": "./migrations/invalid-two-way-bindings/bundle",
      "package": "@angular/core",
      "name": "invalid-two-way-bindings"
    },
    {
      "version": "18.0.0",
      "description": "Replace deprecated HTTP related modules with provider functions",
      "factory": "./migrations/http-providers/bundle",
      "package": "@angular/core",
      "name": "migration-http-providers"
    },
    {
      "version": "18.0.0-0",
      "description": "Updates the Angular CDK to v18",
      "factory": "./ng-update/index#updateToV18",
      "package": "@angular/cdk",
      "name": "migration-v18"
    }
  ]
}
FrozenPandaz commented 1 month ago

The command in step 4 should be nx migrate --run-migrations. That should fix the error.

The error looks wrong though. So we should take a look at that.