2017-07-06 136 views
1

在我的emberjs - 我正在執行firebase數據庫。對於我已經改變了environment設置是這樣的:(請參閱我的意見)EmberJS - 在'firebase`執行時拋出錯誤

module.exports = function(environment) { 
    var ENV = { 
     modulePrefix: 'ember-simple-blog-eee6c', 
     environment: environment, 
     rootURL: '/', 
     contentSecurityPolicy: { 
      'script-src': "'self' 'unsafe-eval' apis.google.com", 
      'frame-src': "'self' https://*.firebaseapp.com", 
      'connect-src': "'self' wss://*.firebaseio.com https://*.googleapis.com" 
     }, 
     firebase: { 
      authDomain: 'ember-simple-blog-eee6c.firebaseapp.com', 
      databaseURL: 'https://ember-simple-blog-eee6c.firebaseio.com/', 
      projectId: "ember-simple-blog-eee6c", 
      storageBucket: "", 
      messagingSenderId: "731960884482" //note sure taken from previous app 
     }, 
     locationType: 'auto', 
     EmberENV: { 
      FEATURES: { 
       // Here you can enable experimental features on an ember canary build 
       // e.g. 'with-controller': true 
      }, 
      EXTEND_PROTOTYPES: { 
       // Prevent Ember Data from overriding Date.parse. 
       Date: false 
      } 
     }, 

     APP: { 
      // Here you can pass flags/options to your application instance 
      // when it is created 
     }, 

     contentSecurityPolicy: { 
      'font-src': "'self' data: fonts.gstatic.com", 
      'style-src': "'self' 'unsafe-inline' fonts.googleapis.com" 
     } 
    }; 

    if (environment === 'development') { 
     // ENV.APP.LOG_RESOLVER = true; 
     // ENV.APP.LOG_ACTIVE_GENERATION = true; 
     // ENV.APP.LOG_TRANSITIONS = true; 
     // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 
     // ENV.APP.LOG_VIEW_LOOKUPS = true; 
    } 

    if (environment === 'test') { 
     // Testem prefers this... 
     ENV.locationType = 'none'; 

     // keep test console output quieter 
     ENV.APP.LOG_ACTIVE_GENERATION = false; 
     ENV.APP.LOG_VIEW_LOOKUPS = false; 

     ENV.APP.rootElement = '#ember-testing'; 
    } 

    if (environment === 'production') { 

    } 

    return ENV; 
}; 

實現這個配置後,我得到的錯誤爲:

Uncaught Error: Could not find module `ember-simple-blog-eee6c/app` imported from `(require)` 

這裏有什麼問題?如何解決這個問題?任何人都請幫助我。

在此先感謝。

+0

爲什麼你有ContentSecurityPolicy的副本? – Cameron

回答

1

我懷疑你的firebase與你的錯誤沒有任何關係。我可以通過給module-prefix一個不正確的名稱在我自己的應用程序上重新創建錯誤。是否有可能在您的Firebase項目之後命名您的module-prefix而不是您的ember項目?如果是這樣,我認爲這可能是原因。我認爲你需要你的modulePrefix和你的Ember項目所在的文件夾名稱相同。

+1

是的,這是真的。非常感謝你! – 3gwebtrain

+0

@ 3gwebtrain很高興聽到它! – Cameron

+0

我剛開始學習Ember。你能推薦一些好的教程嗎? – 3gwebtrain

相關問題