Error: Zone.js has detected that ZoneAwarePromise (window|global).Promise
has been overwritten #501
Description
Using:
- Angular 2.1.0
- Zone.js 0.6.26
- Angular Universal 2.1.0-rc.1
- Webpack 2.1.0-beta.25
I'm receiving the following error from Zone.assertZonePatched()
:
Zone.js has detected that ZoneAwarePromise
(window|global).Promise has been overwritten
I referred to Angular issue #11650, but I get this error regardless of how late I import Zone.js, or if I remove the import altogether. I'm not using Bing as mentioned in #465 and I've checked all of the SO answers as well.
I've manually checked that window.Promise
does in fact look to be patched (using toString
, JSON.stringify
, and the helper method here), so only thing I can think of is that Zone is being loaded twice, but should't this catch that?
To workaround the issue I've added a very hacky line of code to assertZonePatched to just re-patch the thing:
static assertZonePatched() {
window.Promise = ZoneAwarePromise;
...
}
Everything seems to work correctly, but I'm thinking this probably isn't stable, otherwise you guys would have patched window.Promise
at that point in the lifecycle to begin with. Any guidance would be appreciated.