angular-cli: Maximum call stack size exceeded after updating `@angular/compiler-cli`
๐ 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, the previous version in which this bug was not present was: 9.0.2Description
After updating `@angular/compiler-cli 9.0.3` during ng serve I receive following error: `ERROR in Maximum call stack size exceeded`๐ฌ Minimal Reproduction
๐ฅ Exception or Error
ERROR in Maximum call stack size exceeded
๐ Your Environment
ng version _ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / โณ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | | / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | | /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___| |___/ Angular CLI: 9.0.3 Node: 12.13.1 OS: linux x64 Angular: 9.0.3 ... animations, cli, common, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes Package Version ----------------------------------------------------------- @angular-devkit/architect 0.900.3 @angular-devkit/build-angular 0.900.3 @angular-devkit/build-optimizer 0.900.3 @angular-devkit/build-webpack 0.900.3 @angular-devkit/core 9.0.3 @angular-devkit/schematics 9.0.3 @angular/cdk 9.1.0 @angular/compiler 9.0.2 @angular/material 9.1.0 @ngtools/webpack 9.0.3 @schematics/angular 9.0.3 @schematics/update 0.900.3 rxjs 6.5.4 typescript 3.7.5 webpack 4.41.2
Anything else relevant?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 30 (4 by maintainers)
Commits related to this issue
- fix(ngcc): don't crash on cyclic source-map references The source-map flattening was throwing an error when there is a cyclic dependency between source files and source-maps. The error was either a c... — committed to petebacondarwin/angular by petebacondarwin 4 years ago
- fix(ngcc): don't crash on cyclic source-map references The source-map flattening was throwing an error when there is a cyclic dependency between source files and source-maps. The error was either a c... — committed to petebacondarwin/angular by petebacondarwin 4 years ago
- fix(ngcc): don't crash on cyclic source-map references (#36452) The source-map flattening was throwing an error when there is a cyclic dependency between source files and source-maps. The error was e... — committed to angular/angular by petebacondarwin 4 years ago
The possible reasons for the issues are
Some other people reported that deleting their
node_modules
and re-installing got rid of this errorโฆ can you try that?as a WORKAROUND
npm i terser@latest
solved the issue for me. Installed the"terser": "^4.6.4",
The answer of @kalimulhaq helps me, in my case, I was exporting my own module ๐
Seta no angular.json โaotโ: false,
I had this error as well but in slightly different circumstances:
I was trying to build a prod library, this has to have ivy turned off. A library build with Ivy was fine. I tried all the various fixes listed here but nothing helped.
In the end I discovered that barrel files broke it for me.
This code worked fine:
(constants just exports 2 strings)
This code fails:
(exports an index.ts file that just exports * from constants)
The workaround I found was to directly export every file in
public.api
and avoid barrels. The npm lib barrelsby helped a lot with this:barrelsby -e .spec.ts -D true -l top -n public.api
In my case, it happens only once, too. When I retry building again, it works without any problem, even if I havenโt done anything. Thatโs why, some of these solutions may be misleading. ๐ค