Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Zone.js 0.8.17 and Angular-cli / rangeerror maximum call stack size exceeded #886

Closed
mhadaily opened this issue Aug 25, 2017 · 26 comments · Fixed by #887
Closed

Zone.js 0.8.17 and Angular-cli / rangeerror maximum call stack size exceeded #886

mhadaily opened this issue Aug 25, 2017 · 26 comments · Fixed by #887

Comments

@mhadaily
Copy link

I thought that might be helpful If I open an issue in "zone.js" repo instead of "angular-cli".

Please refer to this comment angular/angular-cli#7502 (comment),

@laurentgoudet
Copy link
Contributor

Same issue here, the v0.8.17 update broke our site, although there seems to be other things at play here since in our case disabling NewRelic Browser collection agent, which also patches XMLHttpRequest, "fixes" the issue. Either of them works fine without the other.

@nename0
Copy link

nename0 commented Aug 25, 2017

Same here. I'm using pouchdb and since 0.8.17 when pouchdb makes network requests I get errors like this:

ERROR RangeError: Maximum call stack size exceeded
    at XMLHttpRequestUpload.wrapFn [as __zone_symbol__ON_PROPERTYprogress] (zone.js:1069)
    at XMLHttpRequestUpload.wrapFn [as __zone_symbol__ON_PROPERTYprogress] (zone.js:1075)
    at XMLHttpRequestUpload.wrapFn [as __zone_symbol__ON_PROPERTYprogress] (zone.js:1075)

From a bit of debugging it seems like in the new code at https://github.com/angular/zone.js/blob/master/lib/common/utils.ts#L98 listener gets the wrapFn funtion itself, which causes the infinite loop.

@JiaLiPassion you made this change. Any advice?

@JiaLiPassion
Copy link
Collaborator

please provide a reproduce repo, thanks, I will check it asap.

@laurentgoudet
Copy link
Contributor

Reproduction plunkr here. Sorry NewRelic's code is minified as I couldn't find a way to reproduce it without it.

screen shot 2017-08-25 at 12 13 20

@swftvsn
Copy link

swftvsn commented Aug 25, 2017

Same here, wasted a full day trying to trace this one. We're not using newrelic.

client.js:1587 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
zone.js:196 Uncaught RangeError: Maximum call stack size exceeded
    at XMLHttpRequest.wrapFn (polyfills.bundle.js:1)
    at XMLHttpRequest.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (client.js:1655)
    at XMLHttpRequest.wrapFn (zone.js:1075)
    at XMLHttpRequest.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (client.js:1655)
    at XMLHttpRequest.wrapFn (zone.js:1075)
    at XMLHttpRequest.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (client.js:1655)
    at XMLHttpRequest.wrapFn (zone.js:1075)
    at XMLHttpRequest.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (client.js:1655)
    at XMLHttpRequest.wrapFn (zone.js:1075)
    at XMLHttpRequest.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (client.js:1655)
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask @ zone.js:196
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:499
invokeTask @ zone.js:1427
globalZoneAwareCallback @ zone.js:1445
XMLHttpRequest.send (async)
(anonymous) @ VM230:1
scheduleTask @ zone.js:2744
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:411
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:236
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleMacroTask @ zone.js:259
(anonymous) @ zone.js:2769
proto.(anonymous function) @ zone.js:1274
XMLHttpRequest.send @ client.js:1661
webpackJsonp.../../../../sockjs-client/lib/transport/browser/abstract-xhr.js.AbstractXHRObject._start @ abstract-xhr.js:132
(anonymous) @ abstract-xhr.js:21
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:425
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask @ zone.js:192
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:499
ZoneTask.invoke @ zone.js:488
timer @ zone.js:1896
setTimeout (async)
scheduleTask @ zone.js:1906
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:411
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:236
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleMacroTask @ zone.js:259
(anonymous) @ zone.js:1932
proto.(anonymous function) @ zone.js:1274
AbstractXHRObject @ abstract-xhr.js:20
XHRLocalObject @ xhr-local.js:8
InfoAjax @ info-ajax.js:19
webpackJsonp.../../../../sockjs-client/lib/info-receiver.js.InfoReceiver._getReceiver @ info-receiver.js:36
webpackJsonp.../../../../sockjs-client/lib/info-receiver.js.InfoReceiver.doXhr @ info-receiver.js:56
(anonymous) @ info-receiver.js:25
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:425
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.runTask @ zone.js:192
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:499
ZoneTask.invoke @ zone.js:488
timer @ zone.js:1896
setTimeout (async)
scheduleTask @ zone.js:1906
webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:411
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:236
webpackJsonp.../../../../zone.js/dist/zone.js.Zone.scheduleMacroTask @ zone.js:259
(anonymous) @ zone.js:1932
proto.(anonymous function) @ zone.js:1274
InfoReceiver @ info-receiver.js:24
SockJS @ main.js:121
socket @ socket.js:7
(anonymous) @ client?ffdb:165
../../../../webpack-dev-server/client/index.js?http:/localhost:4200 @ client?ffdb:188
__webpack_require__ @ bootstrap 358e953892e2590113ae:54
0 @ main.bundle.js:5623
__webpack_require__ @ bootstrap 358e953892e2590113ae:54
webpackJsonpCallback @ bootstrap 358e953892e2590113ae:25
(anonymous) @ main.bundle.js:1
zone.js:196 Uncaught RangeError: Maximum call stack size exceeded
... the error keeps popping up ....

@JiaLiPassion
Copy link
Collaborator

JiaLiPassion commented Aug 25, 2017

Thank you everyone, sorry for the breaking error, I have made a PR to fix this one.
please try the attached zone.js.zip to verify whether the issue is resolved or not.
zone.js.zip

@swftvsn
Copy link

swftvsn commented Aug 26, 2017

Hi,

I just tested and the problem is gone! Thank you for the quick turn around!

@JiaLiPassion
Copy link
Collaborator

@swftvsn , thank you for confirmation.

@nename0
Copy link

nename0 commented Aug 26, 2017

Yep, the zip removes the problem for me too

@picosam
Copy link

picosam commented Aug 28, 2017

@JiaLiPassion
Copy link
Collaborator

@nename0 , thanks for confirm.
@picosam, please try the zip posted above to check whether the issue is resolved or not.

@adrienverge
Copy link

@JiaLiPassion, I confirm the zip fixes the problem for me too.

@picosam
Copy link

picosam commented Aug 28, 2017

I'm really sorry, I'm unable to use npm to install the zip above. Would you like me to manually patch the files in node_modules with the ones in the zip and try?

@JiaLiPassion
Copy link
Collaborator

@picosam , yes, please download the zip, unzip and copy it to your node_modules/zone.js/dist folder to override the installed one.

@adrienverge , thank you for confirm.

@laurentgoudet
Copy link
Contributor

I can confirm the patch seems to work as well.

@picosam
Copy link

picosam commented Aug 28, 2017

Me too.

@vincent-cm
Copy link

Me too not using angularCli but webpack only. When navigation programmatically,
The following line is captured in the last line fo error:

at timer (http://0.0.0.0:8080/polyfills.bundle.js:18585:29)

@JiaLiPassion
Copy link
Collaborator

@laurentgoudet , @picosam , thanks for confirm.
@vincent-cm , please wait for next release of zone.js.

@Ismaestro
Copy link

@JiaLiPassion shit happens, we all know xD

@JiaLiPassion
Copy link
Collaborator

@Ismaestro , the new version not released, so please wait for a while. sorry for inconvenience

@lakinmohapatra
Copy link

When new version will be released ? We are eagerly waiting for this.

@toverux
Copy link

toverux commented Sep 8, 2017

@lakinmohapatra You can downgrade to 0.8.16 while waiting for the fix.

@mlc-mlapis
Copy link

@JiaLiPassion ... I can confirm that zone.js.zip solved also the same problem when using raven-js.

@dotlouis
Copy link

dotlouis commented Sep 28, 2017

New 0.8.18 version solved my issue

@lakinmohapatra
Copy link

lakinmohapatra commented Sep 28, 2017 via email

@lvncnt
Copy link

lvncnt commented Sep 29, 2017

tested, use zone.js version 0.8.18 solved the issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet