You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a workspace like nx-examples, where at least two projects have the same folder name, even if they are different paths:
libs/shared/cart/state
libs/shared/product/state
When adding a plugin (in nx.json) which implements CreateNodes (v2) or registerProjectTargets (from v1), nx will crash whenever it tries to build the project graph (ie nx report or nx run-many -t build --all).
Expected Behavior
NX should be able to handle the use case as it did before 16.7.0
nx run-many -t build --all --skip-nx-cache
Debugger attached.
> NX Cannot set properties of undefined (setting 'name')
Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.
If the error persists, please run "nx reset".
Waiting for the debugger to disconnect...
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
It appears this issue was introduced in #18032 when support for multiple projects from plugins was added.
The implementation uses toProjectName utility for generating the unique key for projects. toProjectName assumes the last segment in project root path as the project name.
The issue doesn't depend on the return of CreateNodesFunction in the plugin.
The issue won't happen when the plugin is not declared in nx.json.
This BLOCKS using any plugins after 16.7.0
The text was updated successfully, but these errors were encountered:
JulioC
changed the title
Nx 16.7.0 throws on worksapces with plugins when projects have same folder name but different paths
Nx 16.7.0 throws in workspaces with plugins when projects have same folder name but different paths
Aug 16, 2023
Current Behavior
Consider a workspace like nx-examples, where at least two projects have the same folder name, even if they are different paths:
When adding a plugin (in nx.json) which implements
CreateNodes
(v2) orregisterProjectTargets
(from v1), nx will crash whenever it tries to build the project graph (ienx report
ornx run-many -t build --all
).Expected Behavior
NX should be able to handle the use case as it did before 16.7.0
GitHub Repo
https://github.com/JulioC/nx-examples/tree/bug/16-7-0-plugin
Steps to Reproduce
yarn nx report
Nx Report
Failure Logs
Operating System
Additional Information
It appears this issue was introduced in #18032 when support for multiple projects from plugins was added.
The implementation uses toProjectName utility for generating the unique key for projects.
toProjectName
assumes the last segment in project root path as the project name.The issue doesn't depend on the return of
CreateNodesFunction
in the plugin.The issue won't happen when the plugin is not declared in
nx.json
.This BLOCKS using any plugins after 16.7.0
The text was updated successfully, but these errors were encountered: