nx
nx copied to clipboard
@nrwl/node:node crashes because `context.projectGraph` is undefined but `calculateProjectDependencies` expects it to be defined
Current Behavior
@nrwl/node:node executor crashes because context.projectGraph is undefined but calculateProjectDependencies expects it to be defined.
Expected Behavior
@nrwl/node:node executor doesn't crash because context.projectGraph
isn't a required property of ExecutorContext
.
Steps to Reproduce
Execute @nrwl/node:node executor.
Failure Logs
> nx run create-test-data:serve --verbose=true
> NX Cannot read properties of undefined (reading 'nodes')
TypeError: Cannot read properties of undefined (reading 'nodes')
at calculateProjectDependencies (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/@nrwl/node/node_modules/@nrwl/workspace/src/utilities/buildable-libs-utils.js:17:30)
at calculateResolveMappings (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/@nrwl/node/node_modules/@nrwl/js/src/executors/node/node.impl.js:61:86)
at nodeExecutor_1 (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/@nrwl/node/node_modules/@nrwl/js/src/executors/node/node.impl.js:37:26)
at nodeExecutor_1.next (<anonymous>)
at resume (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/tslib/tslib.js:230:48)
at /Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/tslib/tslib.js:229:125
at new Promise (<anonymous>)
at Object.i.<computed> [as next] (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/tslib/tslib.js:229:67)
at Object.i.<computed> [as next] (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/tslib/tslib.js:240:99)
at nodeExecutor_1 (/Users/Dadi/Desktop/Repositories/dice-10-000/node_modules/@nrwl/node/src/executors/node/node.impl.js:9:46)
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
> NX Running target "create-test-data:serve" failed
Failed tasks:
- create-test-data:serve
Environment
Node : 16.16.0
OS : darwin x64
yarn : 3.2.2
nx : 14.5.1
@nrwl/angular : Not Found
@nrwl/cypress : 14.5.1
@nrwl/detox : Not Found
@nrwl/devkit : 14.5.1
@nrwl/eslint-plugin-nx : 14.5.1
@nrwl/express : Not Found
@nrwl/jest : 14.5.1
@nrwl/js : 14.5.1
@nrwl/linter : 14.5.1
@nrwl/nest : Not Found
@nrwl/next : 14.5.1
@nrwl/node : 14.7.5
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : 14.5.1
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.5.1
@nrwl/web : 14.5.1
@nrwl/workspace : 14.5.1
typescript : 4.7.4
---------------------------------------
Community plugins:
https://github.com/nrwl/nx/blob/94f2fe0b326ca5341bf5e52b8bcf5fc16f982297/packages/js/src/executors/node/node.impl.ts#L69
Hi Daniel, You're using too recent a @nrwl/node version compared to the rest of the @nrwl/* packages. You need to align them either by downgrading @nrwl/node to 14.5.1, or upgrading everything else to 14.7.5.
Could you please align the versions of @nrwl/*
packages and see if the issue still presents itself?
Issue doesn't present itself when versions are aligned. Thanks for the help! 😊
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! 🙏
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.