build --prod RangeError: Maximum call stack size exceeded
See original GitHub issueType of Issue
[*] Bug Report
[ ] Feature Request
Description
I have a @aaa/lib-a
that can be published to gitLab’s NPM library and imported for use in other projects.
When I create a second library @bbb/lib-b
and introduce modules from @aaa/lib-a
, compilation problems arise:
[error] RangeError: Maximum call stack size exceeded
at resolveModuleNamesReusingOldState (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:105667:24)
at processImportedModules (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:107154:35)
at findSourceFileWorker (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106926:17)
at findSourceFile (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106788:26)
at processImportedModules (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:107190:25)
at findSourceFileWorker (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106926:17)
at findSourceFile (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106788:26)
at processImportedModules (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:107190:25)
at findSourceFileWorker (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106926:17)
at findSourceFile (D:\dev\@bbb\lib-b\node_modules\typescript\lib\typescript.js:106788:26)
The
@aaa/lib-a
and@bbb/lib-b
tsconfig configurations are basically the same
If the tsconfig.lib.prod.json
configuration item enableIvy
is changed to true
, it will compile normally, but cannot be published to NPM:
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"enableIvy": true
}
}
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 11.2.4
@angular/compiler: 11.2.14
rollup: 2.38.4
typescript: 4.1.6
rxjs: ~6.5.4
node: v14.17.5
npm: 6.14.14
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
"Maximum call stack size exceeded" in Angular 9 ng build
I introduced a console debug message in function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) function and it seems ...
Read more >Maximum call stack size exceeded after updating @angular ...
After updating `@angular/compiler-cli 9.0.3` during ng serve I receive following error: `ERROR in Maximum call stack size exceeded` ...
Read more >Angular CLI - Module build failed: RangeError: Maximum call ...
Running "ng build --prod" (uses aot and build-optimizer) causes the following error: ... Module build failed: RangeError: Maximum call stack size exceeded.
Read more >JavaScript RangeError: Maximum Call Stack Size Exceeded
The JavaScript RangeError: Maximum call stack size exceeded is an error that occurs when there are too many function calls, or if a...
Read more >Maximum call stack size exceeded – while choosing the ...
Hello, Ravi, Thank you for reporting this issue and for sharing a stackblitz example. It seems the error occurs if all of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When I upgraded to
angular 12
and modified thetsconfig
file, I was fine.This is my repository: (link)
master
branch isangular 11
,angular 12
is inng-12
branch.I think it is important to set
compilationMode
intsconfig.lib.prod.json
topartial
like this:updated versions:
@alan-agius4
There is a time difference between us. I will reply after trying during working hours, tks。