2016-08-04 30 views
0

我最近將一個應用程序從早期的Ionic 2 Alpha版本升級到了最新的Ionic 2 Beta 10.它已經導致我的一些代碼被破壞,並且我有一段糟糕的時間來理解錯誤,來自JavaScript控制檯。所有的TypeScript都捆綁到這個app.bundle.js文件中,這導致控制檯在識別錯誤​​時指向錯誤的代碼區域。理想情況下,我會在控制檯輸出中看到導致錯誤的實際文件。Ionic 2 - 如何理解app.bundle.js錯誤?

有誰知道我該如何做到這一點?

謝謝!

browser_adapter.js:77EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0 
ORIGINAL EXCEPTION: No provider for ConfigService! (ESOService -> ConfigService) 
ORIGINAL STACKTRACE: 
Error: DI Exception 
    at NoProviderError.BaseException [as constructor] (http://localhost:8100/build/js/app.bundle.js:2805:23) 
    at NoProviderError.AbstractProviderError [as constructor] (http://localhost:8100/build/js/app.bundle.js:27996:16) 
    at new NoProviderError (http://localhost:8100/build/js/app.bundle.js:28033:16) 
    at ReflectiveInjector_._throwOrNull (http://localhost:8100/build/js/app.bundle.js:29021:19) 
    at ReflectiveInjector_._getByKeyDefault (http://localhost:8100/build/js/app.bundle.js:29049:25) 
    at ReflectiveInjector_._getByKey (http://localhost:8100/build/js/app.bundle.js:29012:25) 
    at ReflectiveInjector_._getByReflectiveDependency (http://localhost:8100/build/js/app.bundle.js:29002:21) 
    at ReflectiveInjector_._instantiate (http://localhost:8100/build/js/app.bundle.js:28899:36) 
    at ReflectiveInjector_._instantiateProvider (http://localhost:8100/build/js/app.bundle.js:28871:25) 
    at ReflectiveInjector_._new (http://localhost:8100/build/js/app.bundle.js:28860:21) 
ERROR CONTEXT: 
[object Object] 
+0

消息'沒有提供ConfigService! (ESOService - > ConfigService)'非常簡單:你使用'ConfigService'而不將它添加到任何組件的providers數組中。看看你在哪裏使用它,並將它添加到必須使用它的最頂層組件的'providers'數組中。 – sebaferreras

回答

0

許多制動的變化是在不同的版本像.beta8 看看這個頁面GitHub的介紹給您根據更改代碼到最近的changelog

https://github.com/driftyco/ionic/blob/master/CHANGELOG.md

更新離子並開始一個新項目,並重新實現根據changlog的代碼,這將有望消除所有錯誤