ng-packagr: Maximum Call Stack Size Exceeded with version 5
Type of Issue
[X] Bug Report
[ ] Feature Request
Description
After upgrading to ng-packagr 5 I see the following output for a project that builds fine with v4:
BUILD ERROR
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:355:21)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
at MetadataBundler.convertValue (C:\d\ContentHub\prod-wch-sdk-ng7\utils\node_modules\@angular\compiler-cli\src\metadata\bundler.js:372:36)
Downgrading to v4 solves this, without and further changes.
My dependencies:
"dependencies": {
"@ibm-wch-sdk/api": "7.2.601",
"loose-envify": "^1.4.0"
},
"devDependencies": {
"@angular/cli": "^7.3.7",
"@angular/compiler": "^7.2.11",
"@angular/compiler-cli": "^7.2.11",
"@angular/core": "^7.2.11",
"@angular/language-service": "^7.2.11",
"@types/jest": "^23.3.5",
"@types/node": "^11.12.0",
"core-js": "^3.0.0",
"cpx": "^1.5.0",
"jest": "^23.6.0",
"exitzero": "^1.0.1",
"jsdom": "^13.2.0",
"lucene": "^2.0.1",
"ng-packagr": "^5.0.1",
"npm-run-all": "^4.1.5",
"requestidlecallback": "^0.3.0",
"rimraf": "^2.6.3",
"rxjs": "~6.3.3",
"rxjs-marbles": "^3.0.1",
"rxjs-tslint-rules": "^4.11.0",
"sync-files": "^1.0.3",
"tools-helper-merge-markdown": "^0.1.112",
"ts-jest": "^23.10.4",
"ts-node": "^8.0.3",
"tsickle": "^0.34.3",
"tslib": "^1.9.3",
"tslint": "^5.14.0",
"tslint-sonarts": "^1.7.0",
"typedoc": "^0.13.0",
"typedoc-plugin-markdown": "^1.1.17",
"typescript": "~3.2.2",
"url-search-params-polyfill": "^3.0.0",
"uuid": "^3.3.2",
"zone.js": "^0.8.29"
},
This looks similar to #1093 but in my case I am not referencing any barrel files, all imports are referenced via direct file references.
Is there anything in the logging I can do to nail down the problem?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 21 (7 by maintainers)
code that produces error
working code
environment
mhart/alpine-node:10Hi, I tried this locally, and it seems that the issue is related to the node version, when I used
Node 10.10it failed however when using Node 11 it worked as expected.I didn’t find the root cause of this issue though.
Same error:
Also tried it on Node 10. Same error.
Deleting
node_modulesfolder and re-installing all deps fixes the issue.. Although trying to run build the second time results in an error again.By the way, if you are facing this issue as well and do not have the ability to switch to a different Node js version, you can try to downgrade the ng-packagr.
"ng-packagr": "^4.7.0",works for me in our project. Theng updatecommand will install the latest packagr version, so you need to check this after upgrading.Hi, I am not quite sure what is your error. you didn’t provide much information. I suggest you open a new issue and provided all the necessary information unless the error you are seeing is
Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at MetadataBundler.convertValue.I added some console logs to the angular compiler and found that apparently the following line causes the issue:
after patching to
the complete project compiles.