nx
nx copied to clipboard
Nx considers any arbitrary project.json file as nx project file
Current Behavior
after migrating from nx 14.7.5 to to 15.3.3, I started getting this error;

that folder XXX/public/locales/de has project.json, but that project name stands for the project in our app domain. As far as I understood, Nx thinks there is an nx project in that folder and complains about that.
Expected Behavior
- Be able to tell nx to ignore folders from discovering them as nx libs
- Or, be able to completely turn off project.json discovery, because we are using workspace.json anyway
Github Repo
No response
Steps to Reproduce
- add project.json anywhere in an nx lib and run nx workspace-lint
Nx Report
> NX Report complete - copy this into the issue template
Node : 16.15.0
OS : darwin arm64
yarn : 3.2.0
nx : 15.3.3
@nrwl/angular : Not Found
@nrwl/cypress : 15.3.3
@nrwl/detox : Not Found
@nrwl/devkit : 15.3.3
@nrwl/esbuild : Not Found
@nrwl/eslint-plugin-nx : 15.3.3
@nrwl/expo : Not Found
@nrwl/express : Not Found
@nrwl/jest : 15.3.3
@nrwl/js : 15.3.3
@nrwl/linter : 15.3.3
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : 15.3.3
@nrwl/react : 15.3.3
@nrwl/react-native : Not Found
@nrwl/rollup : 15.3.3
@nrwl/schematics : Not Found
@nrwl/storybook : 15.3.3
@nrwl/web : 15.3.3
@nrwl/webpack : 15.3.3
@nrwl/workspace : 15.3.3
typescript : 4.8.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
rxjs: 6.6.7
@wanews/nx-vite: 0.10.1
Failure Logs
No response
Additional Information
No response
This probably can be solved with project inference plugins, but the example you gave in the docs is not clear.
How is that plugin created? is it enough to create libs/awesome-plugin/index.ts? Apparently not, that did not work for me. The other plugins I know are generators and executors, and project-inference doesn't seem to fit those
Hey! This should probably be addresed, but in the meantime you can add that file to .nxignore to avoid it being picked up. One thing to note is that file will no longer be hashed when calculating cache hits if added there.
thanks, @AgentEnder, I worked around this issue by renaming my project.json ( which led to renaming whole bunch of other stuff but that's my problem : ) )
But, yeah, nx should offer a better way to tackle this.
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.