Sentry-javascript: Raven.js XHR wrapped state change handlers causing recursive calls (aka Zone.js infinite loops)

Created on 29 Sep 2017  路  20Comments  路  Source: getsentry/sentry-javascript

Most helpful comment

Same here with latest Ionic 3.7.1 and zone js 0.8.18 : everything looks to work 馃憤 ! The issue was only with 0.8.17

All 20 comments

I just verified everything using latest angular-cli and wasn't able to reproduce this issue.

Repository: https://github.com/kamilogorek/angular-cli-raven-example

Could it be because you're using zone.js 0.8.14 in your package.json?

@marcelgoya, no, it installs 0.8.18 as it should:

screen shot 2017-09-29 at 15 32 06

I also though that it may be due to error being thrown from within a template as @joelnotified mentioned here https://github.com/getsentry/raven-js/issues/1058 but I also couldn't reproduce it.

Added this case here: https://github.com/kamilogorek/angular-cli-raven-example/commit/22a572fc2624c1d8dac42747cf32b5fcfbc42b93

hmm, strange! I'm throwing a test error from inside an injectable static class and that's already enough to generate the loop. it's actually a good way to freeze your browser :-)

Btw, I'd suggest you try one of the Ionic starter templates instead of the NG one...

@joelnotified I was able to fix your repro case by removing strict lock from @angular/core and zone.js and using "@angular/core": "^4.2.4" and "zone.js": "^0.8.14" instead (it'll bump them to 4.4.4 and 0.8.18).

@marcelgoya one step at the time :)

@kamilogorek No worries :)

@marcelgoya can you try to use zone.js 0.8.18 and angular/core 4.4.4 in your package.json, remove package-lock.json/yarn.lock and reinstall all node_modules again? (I've seen that you already did that with zone.js, but wanted to double check, as I see they update their changelog to reflect that https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md)

@kamilogorek Sure, I'm gonna try it in a sec

@kamilogorek Just did the upgrade and reinstalled all node modules like you said but the error is still there :(

I have blocked localhost events in sentry and requests get 403 before infinite loop begins. Maybe it is related and can help in reproducing the issue? Ignore, I disabled localhost filtering and still happens

I am also getting this bug on the occasional XHR request. Unfortunately, I ended up uninstalling raven-js (it was at 3.18.1).

My dependencies are listed below:

    "dependencies": {
        "@angular/common": "^4.4.3",
        "@angular/compiler": "^4.4.3",
        "@angular/compiler-cli": "^4.4.3",
        "@angular/core": "^4.4.3",
        "@angular/forms": "^4.4.3",
        "@angular/http": "^4.4.3",
        "@angular/platform-browser": "^4.4.3",
        "@angular/platform-browser-dynamic": "^4.4.3",
        "@ionic-native/core": "3.6.1",
        "@ionic-native/device": "^3.7.0",
        "@ionic-native/local-notifications": "3.6.1",
        "@ionic-native/splash-screen": "3.6.1",
        "@ionic-native/status-bar": "3.6.1",
        "@ionic/cloud-angular": "^0.12.0",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-console": "1.0.5",
        "cordova-plugin-device": "~1.1.4",
        "cordova-plugin-ionic-webview": "^1.1.9",
        "cordova-plugin-local-notifications": "git+https://github.com/katzer/cordova-plugin-local-notifications.git#x",
        "cordova-plugin-splashscreen": "~4.0.1",
        "cordova-plugin-statusbar": "git+https://github.com/apache/cordova-plugin-statusbar.git",
        "cordova-plugin-whitelist": "1.3.1",
        "cordova-sqlite-storage": "~2.0.0",
        "date-fns": "^1.28.0",
        "ionic-angular": "^3.7.0",
        "ionic-plugin-deploy": "~0.6.6",
        "ionic-plugin-keyboard": "~2.2.1",
        "ionicons": "3.0.0",
        "lodash.pullallby": "^4.7.0",
        "rxjs": "^5.4.3",
        "sw-toolbox": "3.4.0",
        "url-search-params": "^0.9.0",
        "zone.js": "^0.8.18"
    },

It'd be great if someone could help me by providing reproducible code base. I'm not able to break it anymore using @angular/core: 4.4.4 and zone.js: 0.8.18, and it's very hard to track the issue without being able to see it.

I have the same issue. My dependencies are:

"dependencies": {
        "@angular/animations": "4.4.4",
        "@angular/common": "^4.4.4",
        "@angular/compiler": "^4.4.4",
        "@angular/compiler-cli": "^4.4.4",
        "@angular/core": "^4.4.4",
        "@angular/forms": "^4.4.4",
        "@angular/http": "^4.4.4",
        "@angular/platform-browser": "^4.4.4",
        "@angular/platform-browser-dynamic": "^4.4.4",
        "@angular/platform-server": "4.4.4",
        "@ionic-native/core": "^4.3.0",
        "ionic-angular": "^3.7.0",
        "raven-js": "^3.18.1",
        "rxjs": "^5.4.3",
        "sw-toolbox": "3.6.0",
        "videogular2": "^5.2.0",
        "web-animations-js": "^2.3.1",
        "zone.js": "^0.8.18"
    }

@kamilogorek Does your test repo work with these?

@doender Yes, it works just fine. You can try it yourself using this repo https://github.com/kamilogorek/angular-cli-raven-example and replacing it's dependencies with your list.

Thanks. It seems the issue is only with Ionic then?
If I can find the time next week, I'll try to prepare an Ionic starter template like: https://github.com/ionic-team/ionic2-starter-tabs

It was zone.js 0.8.17 issue. You can still break my repo by locking it's version to 0.8.17 and reinstalling dependencies. Anything above that version works just fine.

Same here with latest Ionic 3.7.1 and zone js 0.8.18 : everything looks to work 馃憤 ! The issue was only with 0.8.17

I'm having the same issue with React. any estimation when will this be fixed or is it better to downgrade?

With React? Could you please open new issue and describe it there?

Was this page helpful?
0 / 5 - 0 ratings