Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Maximum call stack size exceeded" when Generating ES5 bundles #16520

Closed
1 of 15 tasks
devinshoemaker opened this issue Dec 31, 2019 · 14 comments
Closed
1 of 15 tasks

"Maximum call stack size exceeded" when Generating ES5 bundles #16520

devinshoemaker opened this issue Dec 31, 2019 · 14 comments

Comments

@devinshoemaker
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, this is a regression. Downgrading @angular-devkit/build-angular to 0.801.2 fixes the issue and ES5 bundles can be created successfully.

Description

A clear and concise description of the problem...

ES5 bundles fail to be generated with the error "Maximum call stack size exceeded". In my case, I am building an application with Ionic, which leverages ES5. This appears to have been introduced with this commit.

🔬 Minimal Reproduction

I have created a repository that demonstrates this bug.

If you downgrade @angular-devkit/build-angular then build will complete successfully.

Issues that don't have enough info and can't be reproduced will be closed.

🔥 Exception or Error




Generating ES5 bundles for differential loading...
An unhandled exception occurred: Call retries were exceeded
See "/private/var/folders/g8/67bzwl0j545gpglt_9z4k8dw0000gn/T/ng-vOpJ85/angular-errors.log" for further details.

🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.3.21
Node: 10.17.0
OS: darwin x64
Angular: 8.2.14
... common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.21
@angular-devkit/build-angular     0.803.21
@angular-devkit/build-optimizer   0.803.21
@angular-devkit/build-webpack     0.803.21
@angular-devkit/core              8.3.21
@angular-devkit/schematics        8.3.21
@angular/cli                      8.3.21
@ngtools/webpack                  8.3.21
@schematics/angular               8.1.3
@schematics/update                0.803.21
rxjs                              6.5.4
typescript                        3.5.3
webpack                           4.39.2
@alan-agius4
Copy link
Collaborator

Duplicate of #16515

@alan-agius4
Copy link
Collaborator

@devinshoemaker, thanks a lot for the repo. Will post it in other issue.

@clydin
Copy link
Member

clydin commented Dec 31, 2019

To confirm behavior, I can reproduce ng build failing.
But the following were successful:

ng build --source-map=false
ng build --prod
ng build --prod --source-map

@devinshoemaker Can you confirm the above on your machine?

@alan-agius4
Copy link
Collaborator

@clydin, I got the same results.

@devinshoemaker
Copy link
Author

@clydin I got the same results as well.

@clydin
Copy link
Member

clydin commented Dec 31, 2019

@devinshoemaker If you have some time can you try one more thing? Add the following source map options to the build target options object (note the vendor: true part) and try an ng build:

            "sourceMap": {
              "scripts": true,
              "styles": true,
              "vendor": true
            }

@devinshoemaker
Copy link
Author

@clydin adding that to my angular.json resulted in a successful build.

@amkoehler
Copy link

Another possible fix: #15493 (comment)

@aledujke
Copy link

@devinshoemaker If you have some time can you try one more thing? Add the following source map options to the build target options object (note the vendor: true part) and try an ng build:

            "sourceMap": {
              "scripts": true,
              "styles": true,
              "vendor": true
            }

This worked for me too, But I have no idea why.

Your other solution works as well: #16515 (comment)

Also runing ng build --prod works for me.

2nd and maybe 3rd suggest this is a memory problem which for me makes some sense, but every single error I've had mentions node_modules\jest-worker\build\workers\processChild.js, also everyone who pasted a log when creating an issue like this mentions jest-worker. Yet my project has no test written yet at all. Is no one suspicious of this? Could this be some jest bug?

@devinshoemaker
Copy link
Author

@aledujke have you updated your Angular version? This was fixed for me in a more recent update.

@anno1985
Copy link

anno1985 commented Mar 4, 2020

I had to downgrade from ^0.803.25 (after running an ng update @angular/cli@^8) to 0.801.2 to get round the issue when trying to run a non-prod ng build --stats-json:

An unhandled exception occurred: Call retries were exceeded
---
[error] Error: Call retries were exceeded
    at ChildProcessWorker.initialize (/sanitized/node_modules/jest-worker/build/workers/ChildProcessWorker.js:193:21)
    at ChildProcessWorker.onExit (/sanitized/node_modules/jest-worker/build/workers/ChildProcessWorker.js:263:12)
    at ChildProcess.emit (events.js:321:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

@anno1985
Copy link

anno1985 commented Mar 4, 2020

I got around the issue with the latest "@angular-devkit/build-angular": "^0.803.25", by running node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --stats-json as suggested by clydin here: #16515 (comment)
The --max_old_space_size flag is discussed here: nodejs/node#7937

@aledujke
Copy link

aledujke commented Mar 6, 2020

@devinshoemaker yes it is fixed for me too now.

neilellis added a commit to socialsensingbot/frontend that referenced this issue Mar 27, 2020
Issue Description: Move slider over to Angular Material

Debugging obscure build failure on Amplify.
Trying: angular/angular-cli#16520
neilellis added a commit to socialsensingbot/frontend that referenced this issue Mar 27, 2020
Issue Description: Move slider over to Angular Material

Debugging obscure build failure on Amplify.
Trying: angular/angular-cli#16520
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants