Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise polyfill has been loaded after Zone.j #413

Closed
jrosseel opened this issue Sep 28, 2016 · 5 comments
Closed

Promise polyfill has been loaded after Zone.j #413

jrosseel opened this issue Sep 28, 2016 · 5 comments

Comments

@jrosseel
Copy link

jrosseel commented Sep 28, 2016

Hi everyone,

I keep getting this error:

zone.js:355 Unhandled Promise rejection: Zone.js has detected that ZoneAwarePromise(window|global).Promisehas been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.) ; Zone: <root> ; Task: Promise.then ; Value: Error: Zone.js has detected that ZoneAwarePromise(window|global).Promisehas been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.) at ...

Does anyone know what might cause this?

This occurred after I upgraded to angular 2.0.1 with angular2-meteor@0.7.0.

Here is my current package configuration:
"dependencies": { "@angular/common": "^2.0.0", "@angular/compiler": "^2.0.0", "@angular/core": "^2.0.0", "@angular/forms": "^2.0.0", "@angular/http": "^2.0.0", "@angular/material": "^2.0.0-alpha.9", "@angular/platform-browser": "^2.0.0", "@angular/platform-browser-dynamic": "^2.0.0", "@angular/router": "^3.0.0-rc.1", "@angular/upgrade": "^2.0.0", "angular2-meteor": "^0.7.0-beta.3", "angular2-meteor-polyfills": "https://registry.npmjs.org/angular2-meteor-polyfills/-/angular2-meteor-polyfills-0.1.1.tgz", "bcrypt": "^0.8.7", "client": "^0.0.1", "meteor-node-stubs": "~0.2.0", "reflect-metadata": "^0.1.8", "rxjs": "^5.0.0-beta.12", "tether": "^1.3.6", "zone.js": "^0.6.25" }
image

@lekev
Copy link

lekev commented Sep 28, 2016

@jrosseel can you send the meteor package definition

@jrosseel
Copy link
Author

jrosseel commented Sep 28, 2016

@lekev This is the packages file in my meteor folder. Hope you meant that one.

`Meteor packages used by this project, one per line.
Check this file (and the other files in this directory) into your repository.

'meteor add' and 'meteor remove' will edit this file for you,
but you can also edit it by hand.

meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.12 # The database Meteor supports right now
reactive-var@1.0.10 # Reactive variable for tracker
jquery@1.11.9 # Helpful client-side library
tracker@1.1.0 # Meteor's client-side reactive programming library

standard-minifier-css@1.2.0 # CSS minifier run for production mode
standard-minifier-js@1.2.0 # JS minifier run for production mode
es5-shim@4.6.14 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.5.8 # Enable ECMAScript2015+ syntax in app code

angular2-compilers
barbatus:angular2-runtime
practicalmeteor:mocha
xolvio:cleaner
hwillson:stub-collections
dispatch:mocha-phantomjs
shell-server@0.2.1
accounts-password@1.3.0
digilord:faker
tmeasday:publish-counts
check
email
alanning:roles
planettraining:material-design-icons-font
chriswessels:hammer`

@lekev
Copy link

lekev commented Sep 28, 2016

I suspect ecmascript to add Promise polyfill . you should remove it

@jrosseel
Copy link
Author

That was indeed the culprit. Thanks alot!!! Been trying to solve this for hours.

@Richie765
Copy link

I had the same problem, but removing ecmascript wasn't an option for me.

I found out that both barbatus:angular2-runtime and barbatus:angular2-polyfills are incompatible with ecmascript. So I uninstalled them.

By the way, is barbatus:angular2-runtime still used for anything? It seems it has been removed from the repo so I think there's no use for it anyway.

In my project first thing I import is

import 'angular2-meteor-polyfills';

Doesn't have to be in every file, just as the first import in the file that is loaded first. /client/main.js would be a good place.

That way you can keep using ecmascript. Perhaps this should be documented somewhere?

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

No branches or pull requests

3 participants