"Cannot find project" error due to .gitignore entries in parent directory (linux specific) #29275
JonMarbach
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is sort of a public service announcement that hopefully people will see if they are having similar issues. My case is maybe a bit rare but maybe there's a more general takeaway...
After upgrading to nx 19, I was getting errors saying "NX Cannot find project" for my angular projects in my monorepo (but this is not specific to v19 because I also tried something from 18 and 20 - same results.) For me, this was only a problem on Linux - Windows worked fine.
Long story short, I had an entry in the parent directory's .gitignore for angular.json which was causing the project graph traversal to omit my angular projects. The reason this is in .gitignore is that we generate angular.json from a script, so our case is a bit rare. I solved this by adding a .nxignore file in my nx root and adding !angular.json to it.
Having files outside the repo control behavior in the repo is very unexpected - please don't do this by default. I just happened to notice others mention something about the .gitignore in their other posts troubleshooting other problems (like #27368 and #29245 .)
Hope this helps someone!
Beta Was this translation helpful? Give feedback.
All reactions