nx
nx copied to clipboard
Project Crystal: AggregateCreateNodesError with version 19.3.0
Current Behavior
When generating a project graph with version 19.3.0, the following error occurs
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
AggregateCreateNodesError: Failed to create nodes
at LoadedNxPlugin.createNodes.<computed> (/Users/zachtindall/Documents/repos/crystal-bug/node_modules/nx/src/project-graph/plugins/internal-api.js:48:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createNodes (/Users/zachtindall/Documents/repos/crystal-bug/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:47:32)
at async consumeMessage (/Users/zachtindall/Documents/repos/crystal-bug/node_modules/nx/src/project-graph/plugins/isolation/messaging.js:34:26)
Expected Behavior
The project graph should be created successfully when using project crystal plugins
GitHub Repo
https://github.com/a88zach/crystal-bug
Steps to Reproduce
- install dependencies
- run
yarn exec nx show project test-lib-1 --verbose
Nx Report
Cannot run due to error processing project graph
~/Documents/repos/crystal-bug - (main) > yarn exec nx report --verbose
NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
"@nx/eslint": "19.3.0",
"@nx/eslint-plugin": "19.3.0",
"@nx/jest": "19.3.0",
"@nx/js": "19.3.0",
"@nx/node": "19.3.0",
"@nx/react": "19.3.0",
"@nx/vite": "19.3.0",
"@nx/web": "19.3.0",
"@nx/workspace": "19.3.0",
"nx": "19.3.0",
Failure Logs
No response
Package Manager Version
yarn 3.8.2
Operating System
- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response
This happens with and without custom plugins listed in the nx.json
@AgentEnder, any thoughts on a workaround to this one?
Same with 19.3.1. Updated the repo with the latest version
Turns out that the options object is now required (or the plugins are not checking for it's existence before accessing it's properties). Adding an empty options object to each plugin in nx.json fixes the issue
{
"plugin": "@nx/eslint/plugin",
"include": ["apps/**/*", "libs/**/*"],
"options": {}
}
This is likely the issue in the eslint plugin: https://github.com/nrwl/nx/blob/master/packages/eslint/src/plugins/plugin.ts#L503
Not sure if this is an issue yet in other plugins
This has been fixed, in the future if a similar error arises it will also have a nicer error message.
@AgentEnder, I have a workaround, but the root cause here as described a few comments up is still not fixed.
The plugins schema does not require an options object, but the nx plugins (at least the eslint plugin) is not allowing an undefined options object
https://github.com/nrwl/nx/blob/master/packages/eslint/src/plugins/plugin.ts#L517
Does not check to see if options is undefined before accessing targetName
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.