Repository navigation
Closed
Labels
P4A relatively minor issue that is not relevant to core functionsarea: animationslegacy animations package only. Otherwise use area: core.needs reproductionThis issue needs a reproduction in order for the team to investigate furtheropen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/animationsIs this a regression?
Not sureDescription
We sometimes see RangeError: Maximum call stack size exceeded error in our production environment. Some of them come from Safari, some from Chrome. I'm attaching a few last frames of the stacktrace (see the section below). I think this is the reason for the issue: https://anchortagdev.com/range-error-maximum-call-stack-size-exceeded-error-using-spread-operator-in-node-js-javascript. Looks like it happens when page contains a lot of DOM elements and code tries to push them all into an array using a spread operator.
🔬 Minimal Reproduction
Sorry, I don't know how to reproduce it.
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Angular CLI: 9.1.5
Node: 12.16.1
OS: darwin x64
Angular: 9.1.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router, upgrade
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.901.5
@angular-devkit/build-angular 0.901.5
@angular-devkit/build-optimizer 0.901.5
@angular-devkit/build-webpack 0.901.5
@angular-devkit/core 7.3.10
@angular-devkit/schematics 7.3.10
@angular/cdk 9.2.3
@angular/cli 9.1.5
@ngtools/webpack 9.1.5
@schematics/angular 9.1.5
@schematics/update 0.901.5
rxjs 6.5.5
typescript 3.7.5
webpack 4.43.0
Reacted by Pavel Shurygin, Dmitry Demeshkin, Konstantin Zhandov, Максим Иванов and Dmitrii Usanov
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsarea: animationslegacy animations package only. Otherwise use area: core.needs reproductionThis issue needs a reproduction in order for the team to investigate furtheropen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).

Activity
[-]`RangeError: Maximum call stack size exceeded` in `@angular/animations` module in Safari[/-][+]`RangeError: Maximum call stack size exceeded` in `@angular/animations` module[/+]th0r commentedon Sep 15, 2020
Any feedback folks?
AleksanderBodurri commentedon Sep 19, 2020
This issue got me really curious so I did some benchmarking with https://jsbench.me
https://jsbench.me/jvkf8ynmgg/1
Each test creates 1000 divs before the test case runs and assigns the result to a variable.
nodeListkept as aNodeListnodeListconverted into anArray(This one is unrelated to this issue but I thought it was interesting)Relevant code
angular/packages/animations/browser/src/render/shared.ts
Lines 183 to 194 in a91f0f6
Maybe changing
to
might resolve this issue and potentially offer a performance increase.
jelbourn commentedon Oct 26, 2020
While we can't reproduce this issue, it looks like the function @AleksanderBodurri mentions could be simplified anyway to something like this:
Feel free to send a PR
fix(animations): replace copy of query selector node-list from "sprea…
angular-automatic-lock-bot commentedon Dec 26, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.