angular-cli: Maximum call stack size exceeded
I’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
Hi I created a project with cli version 1.6.6 and i’ve work on this project about a month, always ng serve testing and today I’ve want to deploy on server and when I run ‘ng build --prod’ it throws ‘Maximum call stack size exceeded…’ I look this post with likely behaviour and doesn’t seem to be fixed 😦
Expected behavior
It should complile without problems.
Minimal reproduction of the problem with instructions
`C:\Users\Diego Mendez\Desktop\innovacion-notaria-digital>ng build --pr od 10% building modules 0/1 modules 1 active …nnovacion-notaria-digita 10% building modules 1/2 modules 1 active …cion-notaria-digital\src 10% building modules 2/3 modules 1 active …acion-notaria-digital\sr 10% building modules 3/4 modules 1 active …acion-notaria-digital\sr 10% building modules 3/5 modules 2 active …nnovacion-notaria-digita 10% building modules 3/6 modules 3 active …cion-notaria-digital\src 10% building modules 4/6 modules 2 active …cion-notaria-digital\src 10% building modules 5/6 modules 1 active …acion-notaria-digital\sr c\styles.scssNode#moveTo was deprecated. Use Container#append. 10% building modules 6/7 modules 1 active …de_modules\css-loader\li 10% building modules 7/8 modules 1 active …acion-notaria-digital\sr Date: 2018-02-15T15:01:56.479Z Hash: 2fc5ae5cead61d445921 Time: 17544ms chunk {scripts} scripts.abd2bc1a81803e88ec1c.bundle.js (scripts) 160 k B [initial] [rendered] chunk {0} styles.b71bf03706da12181fe1.bundle.css (styles) 198 kB [init ial] [rendered] chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 byte s [initial] [rendered] chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial ] [rendered] chunk {3} inline.9d07561b59257af76b95.bundle.js (inline) 1.45 kB [entr y] [rendered]
ERROR in RangeError: Maximum call stack size exceeded at AotSummaryResolver.resolveSummary (C:\Users\Diego Mendez\Deskto p\innovacion-notaria-digital\node_modules@angular\compiler\bundles\co mpiler.umd.js:32815:14) at StaticSymbolResolver._resolveSymbolFromSummary (C:\Users\Diego Mendez\Desktop\innovacion-notaria-digital\node_modules@angular\compil er\bundles\compiler.umd.js:29372:61) at StaticSymbolResolver.resolveSymbol (C:\Users\Diego Mendez\Deskt op\innovacion-notaria-digital\node_modules@angular\compiler\bundles\c ompiler.umd.js:29119:74) at resolveReferenceValue (C:\Users\Diego Mendez\Desktop\innovacion -notaria-digital\node_modules@angular\compiler\bundles\compiler.umd.j s:32059:75) at simplify (C:\Users\Diego Mendez\Desktop\innovacion-notaria-digi tal\node_modules@angular\compiler\bundles\compiler.umd.js:32222:65) at simplifyInContext (C:\Users\Diego Mendez\Desktop\innovacion-not aria-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32 427:20) at simplifyNested (C:\Users\Diego Mendez\Desktop\innovacion-notari a-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32084 :28) at simplify (C:\Users\Diego Mendez\Desktop\innovacion-notaria-digi tal\node_modules@angular\compiler\bundles\compiler.umd.js:32224:36) at simplifyInContext (C:\Users\Diego Mendez\Desktop\innovacion-not aria-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32 427:20) at simplifyNested (C:\Users\Diego Mendez\Desktop\innovacion-notari a-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32084 :28) at simplify (C:\Users\Diego Mendez\Desktop\innovacion-notaria-digi tal\node_modules@angular\compiler\bundles\compiler.umd.js:32224:36) at simplifyInContext (C:\Users\Diego Mendez\Desktop\innovacion-not aria-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32 427:20) at simplifyNested (C:\Users\Diego Mendez\Desktop\innovacion-notari a-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32084 :28) at simplify (C:\Users\Diego Mendez\Desktop\innovacion-notaria-digi tal\node_modules@angular\compiler\bundles\compiler.umd.js:32224:36) at simplifyInContext (C:\Users\Diego Mendez\Desktop\innovacion-not aria-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32 427:20) at simplifyNested (C:\Users\Diego Mendez\Desktop\innovacion-notari a-digital\node_modules@angular\compiler\bundles\compiler.umd.js:32084 :28) `
and this is my package.json
{ "name": "notaria-digital-front", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@agm/core": "^1.0.0-beta.2", "@angular/animations": "^5.2.0", "@angular/cdk": "^5.2.0", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", "@angular/material": "^5.2.0", "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/router": "^5.2.0", "@types/lodash": "^4.14.98", "angular-google-place": "0.0.3", "bootstrap": "^4.0.0", "core-js": "^2.4.1", "jquery": "^3.3.1", "lodash": "^4.17.4", "ng2-pdf-viewer": "^3.0.8", "ng2-rut": "^0.2.1", "rxjs": "^5.5.6", "tether": "^1.4.3", "zone.js": "^0.8.19" }, "devDependencies": { "@angular/cli": "1.6.6", "@angular/compiler-cli": "^5.2.0", "@angular/language-service": "^5.2.0", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~2.0.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~4.1.0", "tslint": "~5.9.1", "typescript": "~2.5.3" } }
What is the motivation / use case for changing the behavior?
Environment
Angular version: 5
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 8.5.0
- Platform: Windows
Others:
Windows 7
12 GB Ram
Sublime text
NPM: 5.6.0
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 19 (9 by maintainers)
Commits related to this issue
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to filipesilva/devkit by filipesilva 6 years ago
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to filipesilva/devkit by filipesilva 6 years ago
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to angular/devkit by filipesilva 6 years ago
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to angular/angular-cli by filipesilva 6 years ago
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to angular/angular-cli by filipesilva 6 years ago
- fix(@angular-devkit/build-optimizer): don't exceed call stack with big files Related to https://github.com/Microsoft/TypeScript/issues/17033 Fix https://github.com/angular/angular-cli/issues/9636 — committed to angular/angular-cli by filipesilva 6 years ago
@dzonatan looked into this a bit today and I am sorry to report this looks like an existing TypeScript bug: https://github.com/Microsoft/TypeScript/issues/17033
I made another repro for that bug using your file, as it is simpler than the existing repro they have there.
It looks like the newly release TS 2.9.1 does not suffer from that problem. Will see if we can update Build Optimizer to use 2.9.1.
Wooow! That was fast! I want to thank you @filipesilva for fixing this so quickly! 🍻 I wish angular core team would work at such speeds.
I was able to reproduce this bug or something very very similar. I have created a repo here.
Steps to reproduce:
That gives the following output:
@filipesilva
Several people who uses
ag-grid
started getting this error after upgrading angular to v6. https://github.com/ag-grid/ag-grid-angular/issues/184#issuecomment-389157855Originally, I though it’s
ag-grid
problem (maybe some circular dependencies) and started looking into it. Deleting line by line I ended up with one file which still causes this “max call stack reached” error. I’ve checked it on several machines with windows 10 - failed on both.To reproduce add that file in your project or just clone this repo and run
ng build --prod
.You should get:
@morganabel - I get this error in my project occasionally. I’ve disabled the build optimizer for now.
I’m getting a similar but slightly different error but it only started after changing form node 8 to 10
@dzonatan that is very interesting information, thank you for taking the time to identify what’s breaking. Will look at it 👍