nrwl / nx

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

Error in `removeTasksFromTaskGraph` when using `NX_BATCH_MODE` #16016

Closed wSedlacek closed 12 months ago

wSedlacek commented 1 year ago

Current Behavior

When running in NX_BATCH_MODE some dependencies have undefined instead of an array resulting in the following error

Expected Behavior

removeTasksFromTaskGraph should not throw

GitHub Repo

No response

Steps to Reproduce

We have quite a complex project graph in our workspace; I haven't determined a minimal reproduction just yet, however something has changed between 15.8.0 and 15.9.0 that caused this error to occur when we use our own batch implementations.

Nx Report

   Node : 18.13.0
   OS   : darwin arm64
   pnpm : 7.30.5

   nx                      : 15.9.0
   @nrwl/js                : 15.9.0
   @nrwl/jest              : 15.9.0
   @nrwl/linter            : 15.9.0
   @nrwl/workspace         : 15.9.0
   @nrwl/angular           : 15.9.0
   @nrwl/cli               : 15.9.0
   @nrwl/cypress           : 15.9.0
   @nrwl/detox             : 15.9.0
   @nrwl/devkit            : 15.9.0
   @nrwl/eslint-plugin-nx  : 15.9.0
   @nrwl/nest              : 15.9.0
   @nrwl/next              : 15.9.0
   @nrwl/node              : 15.9.0
   @nrwl/nx-plugin         : 15.9.0
   @nrwl/react             : 15.9.0
   @nrwl/react-native      : 15.9.0
   @nrwl/tao               : 15.9.0
   @nrwl/web               : 15.9.0
   @nrwl/webpack           : 15.9.0
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @ngrx/effects                    : 15.4.0
   @ngrx/entity                     : 15.4.0
   @ngrx/router-store               : 15.4.0
   @ngrx/store                      : 15.4.0
   @rx-angular/cdk                  : 2.0.0
   @rx-angular/template             : 2.0.0
   @jscutlery/semver                : 2.30.1
   @ngneat/spectator                : 14.0.0
   @ngrx/schematics                 : 15.4.0
   @ngrx/store-devtools             : 15.4.0
   @nx-plugins/vitepress            : 0.0.19
   @nx-tools/nx-container           : 4.0.3
   @trumbitta/nx-plugin-unused-deps : 1.12.1
   eslint-config-rocketyard         : 1.0.0
   eslint-plugin-ngrx               : 2.1.4
   ng-mocks                         : 14.7.3
   ngx-deploy-npm                   : 5.2.0
   nx-electron                      : 14.0.2
   nx-stylelint                     : 15.0.0
   ---------------------------------------
   Local workspace plugins:
         @rocketyard/file-storage-nx
         @rocketyard/focus-nx
         @rocketyard/mongo-nx
         @rocketyard/redis-nx
         @rocketyard/nats-nx
         @rocketyard/github-nx
         @rocketyard/shipit-nx
         @rocketyard/pg-nx
         @flagship-create/flagship-nx
         @rocketyard/orchestrate-nx
         eslint-config-rocketyard
         @rocketyard/terraform-nx
         @flagship-create/nx

Failure Logs

TypeError: Cannot read properties of undefined (reading 'filter')
    at removeTasksFromTaskGraph (/node_modules/.pnpm/packages/nx/src/tasks-runner/utils.ts:269:57)
    at TaskOrchestrator.<anonymous> (/node_modules/.pnpm/packages/nx/src/tasks-runner/task-orchestrator.ts:190:54)
    at Generator.next (<anonymous>)
    at fulfilled (/node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js:164:62)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

https://github.com/nrwl/nx/blob/d9c55aa17c4edf9f801949fee894aeaec80351dc/packages/nx/src/tasks-runner/utils.ts#L269-L271

Additional Information

No response

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] commented 11 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.