-
Notifications
You must be signed in to change notification settings - Fork 406
Zone.js has detected that ZoneAwarePromise (window|global).Promise
has been overwritten.
#465
Comments
Bing overwrites |
Currently running into a similar issue of yours, but I am not using Bing Maps. Being pretty new to web development, I find it very hard to determine which plugin is causing this exactly. What would be the best way to find what is wrong?
|
@yann510 I was seeing this problem as well. At the end of the day, it's what Jakubmal mentioned: loading a separate JS file which may overwrite ZoneAwarePromise. Essentially, you want to ensure that there are no other JS files loading after zone.js which could result in ZoneAwarePromise being overwritten. This could be deliberately reordering the load time of your files, or considering if some JS files could non-deterministically be overwriting ZoneAwarePromise asynchronously. |
@yann510 you would have to list all other libraries that you use so we can take a look |
@henryng24 I got to the root of why my issue was caused. It appears that when I updated some dependencies (notably angular from rc-6 to 2.0.0, zone.js from 0.6.17 to 0.6.25, rxjs from 5.0.0-beta.11 to 5.0.0-beta.12) and this is when I started getting the issue. Here is a link to my package.json config. With this config for some reason when I run npm install it install angular rc-6 at first and when I run npm update, this is where my issue comes in. Hope this helps track down the issue. |
Here's the fix: zone.js MUST be imported AFTER AppModule/AppModuleNgFactory, otherwise it can throw error "ZoneAware promise has been overriden" during bootstrapping. This is because any module or component in your AppModule might actually override the ZoneAware promise. Loading zone.js after AppModule/AppModuleNgFactory ensures its loaded right before bootstrapping the app, with no possibility of being overridden. App.bootstrap.aot example below:
|
@LeParadoxHD , could you create a reproduce repo? Thanks. |
I can't make the project public, the only I know is that is caused by import 'core-js/es/promise'; Which doesn't make so much sense due to my zone.js import is at the end of the polyfills file... |
@LeParadoxHD, sure, I don't have old version of safari, so could you just create an index.html and include |
Moved from angular/angular#11788
http://plnkr.co/edit/xElagaMcBNbYvc7k7Enh?p=preview
Zone breaks when using
Bing Maps
. The global.promise gets overwritten byBing Maps
. The error is delayed 2 secs - see console output.The text was updated successfully, but these errors were encountered: