2

On Meteor 1.4.1.1 since I've updated to the latest Angular 2.0.1 release I struggle against this error: Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwritten

I've tried meteor update and meteor reset but the error is still there.

I've looked for some answers saying that I should load Zone.js after every other scripts. The problem is that I can't control the loading order on Meteor.

Here is my package.json dependencies:

"dependencies": {
    "@angular/common": "^2.0.1",
    "@angular/compiler": "^2.0.1",
    "@angular/core": "^2.0.1",
    "@angular/forms": "^2.0.1",
    "@angular/platform-browser": "^2.0.1",
    "@angular/platform-browser-dynamic": "^2.0.1",
    "angular2": "^2.0.0-beta.17",
    "angular2-meteor": "^0.7.0",
    "angular2-meteor-polyfills": "^0.1.1",
    "bcrypt": "^0.8.7",
    "bluebird": "^3.4.6",
    "chart.js": "^2.3.0",
    "es6-shim": "^0.35.1",
    "meteor-node-stubs": "^0.2.3",
    "reflect-metadata": "^0.1.2",
    "rxjs": "^5.0.0-beta.12",
    "ui-router-ng2": "^1.0.0-beta.3",
    "zone.js": "^0.6.25"
}

and here are my meteor packages:

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
es5-shim@4.6.14                # ECMAScript 5 compatibility for older browsers.
ecmascript@0.5.8              # Enable ECMAScript2015+ syntax in app code

angular2-compilers@0.6.2_1
barbatus:angular2-runtime
deanius:promise
momentjs:moment
fortawesome:fontawesome
dburles:collection-helpers
accounts-password@1.3.0
promise@0.8.4
meteorhacks:ssr
email@1.1.17
jalik:ufs
jalik:ufs-local
service-configuration@1.0.10
accounts-facebook@1.0.10
accounts-google@1.0.10
accounts-twitter@1.1.11
percolate:synced-cron
shell-server`

Any ideas ?

2 Answers2

1

Promise coming from zone.js is beeing overwritten by promise package which is a dependency of ecmascript and deanius:promise.

You need to remove ecmascript and use typescript everywhere (client AND server)

mordka
  • 392
  • 3
  • 11
0

This worked for me. meteor remove barbatus:angular2-runtime meteor remove barbatus:angular2-polyfills

and/or this npm uninstall barbatus:angular2-runtime npm uninstall barbatus:angular2-polyfills

As described here by Richie 765: https://github.com/Urigo/angular2-meteor/issues/413

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.

davedonohue
  • 212
  • 5
  • 14