nx: 16.4: Failed to process the project graph with "nx-js-graph-plugin"

Current Behavior

After upgrading nx from 16.3 to 16.4, yarn build fails to find any projects:

 >  NX   Failed to process the project graph with "nx-js-graph-plugin".

   Source project does not exist: @rnx-kit/patcher-rnmacos

Expected Behavior

yarn build successfully builds all packages in the repository.

GitHub Repo

https://github.com/microsoft/rnx-kit

Steps to Reproduce

  1. Checkout the branch in https://github.com/microsoft/rnx-kit/pull/2500
  2. Run yarn build

Nx Report

>  NX   Failed to process the project graph with "nx-js-graph-plugin".

   Source project does not exist: @rnx-kit/tools-workspaces

   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".

Failure Logs

>  NX   Failed to process the project graph with "nx-js-graph-plugin".

   Source project does not exist: @rnx-kit/tools-workspaces

   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".

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Full build log here: https://github.com/microsoft/rnx-kit/actions/runs/5474602740/jobs/9969582689?pr=2500

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 6
  • Comments: 25 (8 by maintainers)

Most upvoted comments

We seem to have the same/a similar problem when running npx nx run-many --target=lint but only on Azure Pipelines. Upgrading to 16.5.3 and removing npmScope did not help.

Edit: Sorry I didn’t read correctly, we have a slightly different problem here our error was

 >  NX   Failed to process the project graph with "nx-js-graph-plugin".

   Maximum call stack size exceeded

The Lerna issue is not related, despite the similar error report @SF97

I have an issue which seems to be related, at least the output is somewhat the same. I can reproduce it with Lerna. Here’s the full description: https://github.com/lerna/lerna/issues/3807

The issue happens when hot loading NX 16.3 or higher with pnpm dlx

Not sure if this will help you, but we temporarily fixed this by given the Azure workers more cores (4 cores seems to work for us). But this is of course only possible if you are running self-hosted workers.

Workaround: Remove npmScope from nx.json.

The value of sourceProjectName passed to addDependency is the full project name with scope, but the graph contains names without scope, thus failing this check here:

https://github.com/nrwl/nx/blob/3edbe49fa2ea0503547ba5bff707a67382fb4d13/packages/nx/src/project-graph/project-graph-builder.ts#L258-L263

Update: I’ve just learned that npmScope was deprecated in 16.2 (https://github.com/nrwl/nx/commit/6b928bc250406aa5c31cb56b07361596d64e90dd). It isn’t scheduled to be removed until 17 though.