2015-08-31 97 views
1

我有一個網站廣泛使用AngularJS。當在我的機器上使用MAMP或簡單的python http服務器在本地測試網站時,一切正常。然而,當我在遠程服務器上的網站部署,我收到以下錯誤AngularJS:

Error: [$injector:modulerr] Failed to instantiate module AppBootstrap due to: 
URL does not match any environments 
http://errors.angularjs.org/1.4.0-rc.1/$injector/modulerr?p0=AppBootstrap&p1=URL%20does%20not%20match%20any%20environments 

可能是什麼問題,是令人驚訝的不讓它在本地突破?

我對AngularJS的知識非常有限。我注意到,當我在本地打開主要網頁而沒有設置任何本地服務器時,出現完全相同的錯誤。

+0

這聽起來像'html5Mode'和URL重寫的問題。什麼是你部署到遠程服務器? – Claies

+0

,你能展示一下該模塊(AppBootstrap)使用的''在我的'index.html'文件中。 – michaelchablais

回答

0

基於錯誤消息的這部分,我的猜測是,你有什麼地方有條件的設置,是爲了動態地使基於調試/開發/測試/生產環境的更新:

p1=URL%20does%20not%20match%20any%20environments

我d檢查遠程服務器上使用的URL是否符合條件中的要求,或者相應地更新模塊。

相關問題