Search code examples
javascriptnode.jsmonoreponrwl-nxyarnpkg-v2

After doing a migration to nx's latest (16.7.4) projects stopped being detected


After trying to migrate nx to the latest version via:

nx migrate latest

and running the migrations and yarn my projects in the monorepo stopped being detected by int:

nx show projects

Simply outputs blank.

The setup is:

  • nx v16.7.4 (local)
  • yarn 3.6.1
  • node 16.19.1

And I use asdf on an M1 mac.

If I revert back to a previous version of nx (15.9.2) all work fine. I'm busting yarn and nx caches as well as deleting yarn.lock and/or removing node_modules without luck.

Any idea/suggestion on how we can trace this or how to fix it?


Solution

  • After a bit of digging on my env I could find the root of it.

    TL;DR please look into your ignore files both on your project directory but as well your home directory and check if they contain either:

    • *.json
    • project.json
    • package.json

    If so then nx won't be finding your apps and libs as their project.json files will be ignored.

    Basically on my specific case I had a .ignore file, on macOS, that I really don't know what tool created it (intelliJ, solargraph, ?) hence my files started being ignored after 16.6.0.

    After removing those ignore entries it all started working properly.