-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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 with large SVG #45564
Comments
I suspect that this has less to do with the fact that we're chaining and more that all our walker logic is based on recursion. |
Yeah that is pretty common as it's all visitors; the problem is how a linear sequence of elements (which is not susceptible to stack depth limits) becomes a nested hierarchy of call expressions (and therefore stack depth becomes a limitation due to the recursive nature of visitors) |
Our logic for generating code from an AST uses recursion which limits the number of expressions we can nest before we reach the call stack limit. These changes add a limit in order to avoid errors in some cases where the chains become extremely long. Fixes angular#45564.
Our logic for generating code from an AST uses recursion which limits the number of expressions we can nest before we reach the call stack limit. These changes add a limit in order to avoid errors in some cases where the chains become extremely long. Fixes angular#45564.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was: 13.2.2 (I think)
We noticed this while upgrading from Angular 12 to 13. For now, we will upgrade to 13.2.2 instead of the latest.
Description
When compiling an app that has a large SVG in a template, the build fails with a "Maximum call stack size exceeded" error. This happens on both
ng serve
andng build
.Please note: I understand my minimal reproduction may not be the ideal way to host SVGs in templates, however this is a rudimentary example to replicate an issue that we are seeing in our codebase. Thanks for understanding!
🔬 Minimal Reproduction
https://github.com/sightsoundtheatres/call-stack-repro
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
If I run
node --stack-size=10000 ./node_modules/.bin/ng serve
the program builds and serves just fine. However, this is obviously not an ideal solution.The text was updated successfully, but these errors were encountered: