nrwl / nx

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

The affected projects might have not been identified properly. The package(s) @angular/animations, @angular/cdk, ...... #22328

Closed work933k closed 6 months ago

work933k commented 6 months ago

Current Behavior

Hi, I'm upgrading our nx-workspace from nx v16.3.2 to nx v18.0.8 (and Angular v17 upgraded). When i run the following command:

 npx nx print-affected --target="lint,stylelint,betterer,build,e2e,test,test-storybook" --select="projects"

i get the error:

The affected projects might have not been identified properly. The package(s) @angular/animations, @angular/cdk, @angular/common, @angular/compiler, @angular/core, @angular/forms, @angular/google-maps, @angular/localize, @angular/material, @angular/material-moment-adapter, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/router, @ngrx/effects, @ngrx/entity, @ngrx/router-store, @ngrx/store, @nx/angular, angular-in-memory-web-api, echarts, ngrx-store-localstorage, ngx-echarts, ngx-mask, ngx-page-scroll, ngx-page-scroll-core, ngx-translate-multi-http-loader, zone.js, @angular-devkit/build-angular, @angular-devkit/core, @angular-devkit/schematics, @angular-eslint/eslint-plugin, @angular-eslint/eslint-plugin-template, @angular-eslint/template-parser, @angular/cli, @angular/compiler-cli, @angular/language-service, @ngrx/eslint-plugin, @ngrx/schematics, @ngrx/store-devtools, @nx/cypress, @nx/devkit, @nx/eslint-plugin, @nx/express, @nx/jest, @nx/js were not found. Please open an issue in GitHub including the package.json file.
 NX  Use `nx show projects --affected`, `nx affected --graph -t build` or `nx graph --affected` depending on which best suits your use case. The `print-affected` command will be removed in Nx 19.

 NX   Daemon process terminated and closed the connection

Please rerun the command, which will restart the daemon.
If you get this error again, check for any errors in the daemon process logs found in: /root/.../.nx/cache/d/daemon.log

The final few rows in the daemon.log:

[NX Daemon Server] - 2024-03-15T13:26:47.973Z - Done responding to the client handleHashTasks
[NX Daemon Server] - 2024-03-15T13:26:47.974Z - Handled HASH_TASKS. Handling time: 6. Response time: 1.
[NX Daemon Server] - 2024-03-15T13:26:47.990Z - [REQUEST]: Responding to the client. handleHashTasks
[NX Daemon Server] - 2024-03-15T13:26:47.990Z - Done responding to the client handleHashTasks
[NX Daemon Server] - 2024-03-15T13:26:47.990Z - Handled HASH_TASKS. Handling time: 5. Response time: 0.
/root/.../node_modules/nx/src/hasher/native-task-hasher-impl.js:32
        const plans = this.planner.getPlansReference(tasks.map((t) => t.id), taskGraph);
                                   ^

TypeError: Cannot convert undefined or null to object
    at NativeTaskHasherImpl.hashTasks (/root/.../node_modules/nx/src/hasher/native-task-hasher-impl.js:32:36)
    at InProcessTaskHasher.hashTasks (/root/.../node_modules/nx/src/hasher/task-hasher.js:53:50)
    at handleHashTasks (/root/.../node_modules/nx/src/daemon/server/handle-hash-tasks.js:20:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleResult (/root/.../node_modules/nx/src/daemon/server/server.js:110:16)
    at async handleMessage (/root/.../node_modules/nx/src/daemon/server/server.js:84:9)
    at async /root/.../node_modules/nx/src/daemon/server/server.js:45:9

Node.js v18.16.0

Before the upgrade i didn't have this error. I did directly upgrade to a more recent Angular version (v17.3.0). Can that be causing the issue? I ran: npx nx migrate @angular/core@17.3.0 (and also for the other libs).

Expected Behavior

I expected to get a list of affected projects.

GitHub Repo

No response

Steps to Reproduce

{
  "name": "...-nx",
  "version": "0.1.0",
  "license": "MIT",
  "scripts": {
    "audit": "npx audit-ci --config=ci/audit-ci.json",
    "ng": "nx",
    "postinstall": "node ./decorate-angular-cli.js && npx patch-package",
    "nx": "nx",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "test:watch": "ng test --watch",
    "lint:run-many:fix": "nx run-many --all --target=lint --fix",
    "stylelint:run-many:fix": "nx run-many --all --target=stylelint",
    "e2e": "ng e2e",
    "affected:apps": "nx affected:apps",
    "affected:libs": "nx affected:libs",
    "affected:build": "nx affected:build",
    "affected:e2e": "nx affected:e2e",
    "affected:test": "nx affected:test",
    "affected:lint": "nx affected:lint",
    "affected:dep-graph": "nx affected:dep-graph",
    "affected": "nx affected",
    "format": "nx format:write",
    "format:all": "nx format:write --all",
    "format:write": "nx format:write",
    "format:check": "nx format:check",
    "lint-fix": "eslint . --ext .js",
    "update": "nx migrate latest",
    "dep-graph": "nx dep-graph",
    "help": "nx help",
    "prepare": "husky install",
    "cypress-open": "$(npm bin)/cypress open",
    "validate-lint-rules": "npx eslint-config-prettier index.js",
    "workspace-generator": "nx workspace-generator",
    "sync-website-assets": "cd libs/shared/website-assets && ./update.sh"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "17.3.0",
    "@angular/cdk": "17.3.0",
    "@angular/common": "17.3.0",
    "@angular/compiler": "17.3.0",
    "@angular/core": "17.3.0",
    "@angular/forms": "17.3.0",
    "@angular/google-maps": "17.3.0",
    "@angular/localize": "17.3.0",
    "@angular/material": "17.3.0",
    "@angular/material-moment-adapter": "17.3.0",
    "@angular/platform-browser": "17.3.0",
    "@angular/platform-browser-dynamic": "17.3.0",
    "@angular/router": "17.3.0",
    "@googlemaps/js-api-loader": "1.16.6",
    "@microsoft/applicationinsights-web": "3.1.0",
    "@ngrx/effects": "17.0.1",
    "@ngrx/entity": "17.0.1",
    "@ngrx/router-store": "17.0.1",
    "@ngrx/store": "17.0.1",
    "@ngx-translate/core": "15.0.0",
    "@ngx-translate/http-loader": "8.0.0",
    "@nx/angular": "18.0.8",
    "@storybook/core-server": "7.6.17",
    "@swc/helpers": "0.5.6",
    "angular-gauge": "5.0.0",
    "angular-in-memory-web-api": "0.17.0",
    "chart.js": "3.9.1",
    "chartjs-plugin-datalabels": "2.2.0",
    "d3": "7.8.5",
    "date-fns": "2.30.0",
    "echarts": "5.5.0",
    "express-http-proxy": "2.0.0",
    "file-saver": "2.0.5",
    "libphonenumber-js": "1.10.58",
    "ng2-charts": "4.0.2",
    "ngrx-store-localstorage": "17.0.0",
    "ngx-cookie": "6.0.1",
    "ngx-echarts": "17.1.0",
    "ngx-guided-tour": "2.0.1",
    "ngx-logger": "5.0.12",
    "ngx-mask": "17.0.4",
    "ngx-page-scroll": "12.0.0",
    "ngx-page-scroll-core": "12.0.0",
    "ngx-translate-multi-http-loader": "17.0.0",
    "rxjs": "7.8.1",
    "serve-static": "1.15.0",
    "tslib": "2.5.0",
    "zone.js": "0.14.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "17.3.0",
    "@angular-devkit/core": "17.3.0",
    "@angular-devkit/schematics": "17.3.0",
    "@angular-eslint/eslint-plugin": "17.0.1",
    "@angular-eslint/eslint-plugin-template": "17.0.1",
    "@angular-eslint/template-parser": "17.0.1",
    "@angular/cli": "~17.1.0",
    "@angular/compiler-cli": "17.3.0",
    "@angular/language-service": "17.3.0",
    "@angularclass/hmr": "3.0.0",
    "@babel/core": "7.24.0",
    "@babel/preset-env": "7.24.0",
    "@babel/preset-typescript": "7.23.3",
    "@betterer/betterer": "5.4.0",
    "@betterer/eslint": "5.4.0",
    "@betterer/typescript": "^5.4.0",
    "@chromatic-com/storybook": "1.2.18",
    "@compodoc/compodoc": "1.1.23",
    "@cypress/code-coverage": "3.12.29",
    "@geometricpanda/storybook-addon-badges": "2.0.2",
    "@istanbuljs/nyc-config-typescript": "1.0.2",
    "@jsdevtools/coverage-istanbul-loader": "3.0.5",
    "@ng-apimock/core": "3.11.2",
    "@ng-apimock/cypress-plugin": "3.0.0",
    "@ng-apimock/dev-interface": "3.3.1",
    "@ngneat/until-destroy": "10.0.0",
    "@ngrx/eslint-plugin": "17.0.1",
    "@ngrx/schematics": "17.0.1",
    "@ngrx/store-devtools": "17.0.1",
    "@nx/cypress": "18.0.8",
    "@nx/devkit": "18.0.8",
    "@nx/eslint": "18.0.8",
    "@nx/eslint-plugin": "18.0.8",
    "@nx/express": "18.0.8",
    "@nx/jest": "18.0.8",
    "@nx/js": "18.0.8",
    "@nx/node": "18.0.8",
    "@nx/plugin": "18.0.8",
    "@nx/storybook": "18.0.8",
    "@nx/web": "18.0.8",
    "@nx/webpack": "18.0.8",
    "@nx/workspace": "18.0.8",
    "@schematics/angular": "17.3.0",
    "@spaceribs/nx-betterer": "2.0.2",
    "@storybook/addon-a11y": "7.6.17",
    "@storybook/addon-coverage": "1.0.1",
    "@storybook/addon-essentials": "7.6.17",
    "@storybook/addon-interactions": "7.6.17",
    "@storybook/addons": "7.6.17",
    "@storybook/angular": "7.6.17",
    "@storybook/cli": "7.6.17",
    "@storybook/jest": "0.2.3",
    "@storybook/test-runner": "0.11.0",
    "@storybook/testing-library": "0.2.2",
    "@storybook/theming": "7.6.17",
    "@svgr/webpack": "8.1.0",
    "@swc-node/register": "1.8.0",
    "@swc/cli": "0.3.10",
    "@swc/core": "1.3.107",
    "@swc/jest": "0.2.36",
    "@swc/wasm": "1.4.6",
    "@types/d3": "7.4.1",
    "@types/express": "4.17.18",
    "@types/googlemaps": "3.43.3",
    "@types/jest": "29.5.5",
    "@types/node": "18.16.9",
    "@types/webpack-env": "1.18.4",
    "@typescript-eslint/eslint-plugin": "6.21.0",
    "@typescript-eslint/parser": "6.21.0",
    "@typescript-eslint/utils": "6.21.0",
    "audit-ci": "6.6.1",
    "autoprefixer": "10.4.18",
    "babel-loader": "9.1.3",
    "babel-preset-env": "1.7.0",
    "canvas": "2.11.2",
    "chromatic": "11.0.8",
    "compodoc": "0.0.41",
    "cors": "2.8.5",
    "cypress": "^13.0.0",
    "cypress-fail-on-console-error": "5.1.0",
    "cypress-file-upload": "5.0.8",
    "cypress-multi-reporters": "1.6.4",
    "cypress-plugin-tab": "1.0.5",
    "deepmerge-ts": "5.1.0",
    "detect-port": "1.5.1",
    "eslint": "8.48.0",
    "eslint-config-prettier": "9.1.0",
    "eslint-plugin-cypress": "2.15.1",
    "eslint-plugin-deprecation": "2.0.0",
    "eslint-plugin-jasmine": "4.1.3",
    "eslint-plugin-jsdoc": "48.2.1",
    "eslint-plugin-json": "3.1.0",
    "eslint-plugin-rxjs": "5.0.3",
    "eslint-plugin-sonarjs": "0.24.0",
    "eslint-plugin-storybook": "0.8.0",
    "eslint-plugin-yaml": "0.5.0",
    "husky": "8.0.3",
    "istanbul": "0.4.5",
    "istanbul-lib-coverage": "3.2.2",
    "jest": "29.7.0",
    "jest-environment-jsdom": "29.7.0",
    "jest-fail-on-console": "3.1.2",
    "jest-image-snapshot": "6.4.0",
    "jest-junit": "16.0.0",
    "jest-preset-angular": "14.0.3",
    "jsonc-eslint-parser": "2.4.0",
    "lint-staged": "15.2.2",
    "mocha-junit-reporter": "2.2.1",
    "ng-mocks": "14.12.1",
    "ng-packagr": "17.3.0",
    "ngx-scrollbar": "13.0.3",
    "ngx-translate-testing": "7.0.0",
    "nx": "18.0.8",
    "nx-remotecache-azure": "18.0.0",
    "nx-stylelint": "17.1.4",
    "nyc": "15.1.0",
    "patch-package": "8.0.0",
    "playwright-chromium": "1.42.1",
    "playwright-webkit": "1.42.1",
    "postcss": "8.4.35",
    "postcss-import": "16.0.1",
    "postcss-preset-env": "~9.5.0",
    "postcss-url": "10.1.3",
    "prettier": "2.8.8",
    "raw-loader": "4.0.2",
    "start-server-and-test": "2.0.3",
    "storybook": "7.6.17",
    "storybook-addon-pseudo-states": "2.2.1",
    "stylelint": "16.2.1",
    "stylelint-config-recess-order": "5.0.0",
    "stylelint-config-recommended-scss": "14.0.0",
    "stylelint-config-standard": "36.0.0",
    "stylelint-scss": "6.2.1",
    "ts-jest": "29.1.2",
    "typescript": "5.3.3"
  },
  "overrides": {
    "@babel/traverse": ">=7.23.2",
    "@spaceribs/nx-betterer": {
      "@nx/devkit": "^18.0.0",
      "@nx/web": "^18.0.0"
    }
  },
  "engines": {
    "node": "^18.16.0",
    "npm": "^9.5.1",
    "pnpm": ">=7"
  },
  "engineStrict": true
}

Nx Report

Node   : 18.16.0
OS     : linux-x64
npm    : 9.5.1

nx                 : 18.0.8
@nx/js             : 18.0.8
@nx/jest           : 18.0.8
@nx/linter         : 18.0.8
@nx/eslint         : 18.0.8
@nx/workspace      : 18.0.8
@nx/angular        : 18.0.8
@nx/cypress        : 18.0.8
@nx/devkit         : 18.0.8
@nx/eslint-plugin  : 18.0.8
@nx/express        : 18.0.8
@nx/node           : 18.0.8
@nx/plugin         : 18.0.8
@nx/storybook      : 18.0.8
@nrwl/tao          : 18.0.8
@nx/web            : 18.0.8
@nx/webpack        : 18.0.8
typescript         : 5.3.3
---------------------------------------
Community plugins:
@compodoc/compodoc     : 1.1.23
@ngrx/effects          : 17.0.1
@ngrx/entity           : 17.0.1
@ngrx/eslint-plugin    : 17.0.1
@ngrx/router-store     : 17.0.1
@ngrx/schematics       : 17.0.1
@ngrx/store            : 17.0.1
@ngrx/store-devtools   : 17.0.1
@spaceribs/nx-betterer : 2.0.2
@storybook/angular     : 7.6.17
ng-mocks               : 14.12.1
ng2-charts             : 4.0.2
nx-stylelint           : 17.1.4
---------------------------------------
Local workspace plugins:
         @...-nx/storybook-test-runner
         @...-nx/static-server
         @...-nx/azuredevops
         @...-nx/chromatic
         @...-nx/workspace-plugin

Failure Logs

No response

Package Manager Version

npm v9.5.1

Operating System

Additional Information

I added some logging to the function: async hashTasks(tasks, taskGraph, env). The parameter taskGraph here as a value of undefined.

work933k commented 6 months ago

Never mind.. I found the issue. It was caused by having package-lock.json in the .nxignore file..

github-actions[bot] commented 5 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.