2016-10-05 66 views
2

在流星1.4.1.1,因爲我已經更新到最新的2.0.1角釋放我反對這種錯誤的鬥爭:Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwrittenZoneAwarePromise已被覆蓋上流星

我試過meteor updatemeteor reset但錯誤依然那裏。

我找了一些答案,說我應該在每個其他腳本後加載Zone.js。問題是我無法控制Meteor的加載順序。

這裏是我的package.json依賴:

"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" 
} 

,這裏是我的流星包:

[email protected]    # Packages every Meteor app needs to have 
[email protected]  # Packages for a great mobile UX 
[email protected]     # The database Meteor supports right now 
[email protected]   # Reactive variable for tracker 
[email protected]     # Helpful client-side library 
[email protected]     # Meteor's client-side reactive programming library 

[email protected] # CSS minifier run for production mode 
[email protected]    # ECMAScript 5 compatibility for older browsers. 
[email protected]    # Enable ECMAScript2015+ syntax in app code 

[email protected]_1 
barbatus:angular2-runtime 
deanius:promise 
momentjs:moment 
fortawesome:fontawesome 
dburles:collection-helpers 
[email protected] 
[email protected] 
meteorhacks:ssr 
[email protected] 
jalik:ufs 
jalik:ufs-local 
[email protected] 
[email protected] 
[email protected] 
[email protected] 
percolate:synced-cron 
shell-server` 

任何想法?

+0

我得到同樣的錯誤。使用@angular版本2.0.0 RC4 – davedonohue

回答

1

Promisezone.js未來被與否有關promise包這是ecmascriptdeanius:promise依賴性覆蓋。

你需要到處卸下ecmascript和使用打字稿(客戶端和服務器)

0

這爲我工作。 meteor remove barbatus:angular2-runtime meteor remove barbatus:angular2-polyfills

和/或本 npm uninstall barbatus:angular2-runtime npm uninstall barbatus:angular2-polyfills

正如裏奇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.