Max Call Stack error when running build --with-deps
See original GitHub issueCurrent Behavior
After upgrading to Nx v9 running nx build --with-deps
fails with the following error
/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:72
function recur(node) {
^
RangeError: Maximum call stack size exceeded
at recur (/Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:72:19)
at /Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:76:13
at Array.forEach (<anonymous>)
at recur (/Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:75:12)
at /Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:76:13
at Array.forEach (<anonymous>)
at recur (/Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:75:12)
at /Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:76:13
at Array.forEach (<anonymous>)
at recur (/Users/jaybell/WebstormProjects/shinkansen/node_modules/@nrwl/workspace/src/core/project-graph/operators.js:75:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This errors shows up with 4/5 of my Angular apps and 1/2 of my Nest apps.
The 1 angular app and 1 nest app that work are both pretty small compared to the others.
Running build normally nx build
works totally fine.
Expected Behavior
Even though I have no buildable libraries I would expect that a build would succeed with the -with-deps
flag like it does for the one angular app.
Steps to Reproduce
I am not able to repro this on nx-examples, which leads me to believe that it has something to do with my repository itself.
When I serve the apps that do not work with the deps flag there are no circular deps detected.
I have compared my tsconfig files and angular.json records with those of the apps that do work and there are no (or only slight) differences, even when they are identical the apps still fail to build --with-deps
.
The error seems to be happening while it builds the dependency graph to determine what dependencies to build but when I run affected:dep-graph
it runs fine, no max call stack error. I am also able to run tests fine.
I have tried it on nx v9.5.1, 9.5.0 and 9.4.0 just to see if it was a regression in a minor or patch version.
Even if I remove all module imports in my AppModule for an app that does not build (and their associated imports) as well as deleting all routes in the AppRoutingModule the build still fails with the same error (even though theoretically the app isn’t depending on anything, for the most part)
Please let me know if there is any information I am missing or any specific configuration files that would be helpful to see.
Environment
@nrwl/angular : 9.4.5
@nrwl/cli : 9.4.5
@nrwl/cypress : 9.4.5
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : 9.4.5
@nrwl/jest : 9.4.5
@nrwl/linter : 9.4.5
@nrwl/nest : 9.4.5
@nrwl/next : Not Found
@nrwl/node : 9.4.5
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 9.4.5
@nrwl/web : Not Found
@nrwl/workspace : 9.4.5
typescript : 3.8.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (10 by maintainers)
It has been fixed in 10.0.6. It’ll also be a part of 9.6 release.
@vsavkin wondering if there is a timeline on 9.6 release?