question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Max Call Stack error when running build --with-deps

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
vsavkincommented, Jul 24, 2020

It has been fixed in 10.0.6. It’ll also be a part of 9.6 release.

1reaction
yharaskrikcommented, Jul 29, 2020

@vsavkin wondering if there is a timeline on 9.6 release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximum call stack size exceeded on npm install
from the official docs: > This command runs the npm build command on the matched folders. This is useful when you install a...
Read more >
width-deps causes Maximum call stack size exceeded error
Current Behavior. Running nx affected:build --with-deps throws a Maximum call stack size exceeded error. Failure Information (for bugs).
Read more >
How to fix npm maximum call stack size exceeded error
First, make sure that you are using the latest NodeJS and npm versions for your project. Now the npm install command sometimes builds...
Read more >
Npm install maximum call stack size exceeded ?? - Laracasts
I installed fresh laravel 5.7. and tried to npm install.. it gives following error log 3264 verbose stack RangeError: Maximum call stack size...
Read more >
npm install fails with "npm ERR! Maximum call stack size ...
NPM then runs for ~15 minutes until it hits "npm ERR! Maximum call stack size exceeded" see screenshot. error-20200428. Extract from attached error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found