EmberJS - 在 `firebase` 实现上抛出错误
EmberJS - throw error on `firebase` implementation
在我的 emberjs
中 - 我正在实施 firebase
数据库。为此,我更改了 environment
设置,如下所示:(请参阅我的评论)
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)`
这里有什么问题?如何解决这个问题?任何人都请帮助我。
提前致谢。
我怀疑你的firebase与你的错误无关。通过给 module-prefix
一个不正确的名称,我可以在我自己的应用程序上重现您的错误。您是否可以在您的 firebase 项目而不是 ember 项目之后命名您的 module-prefix
?如果是这样,我认为这可能是原因。我想你需要你的 modulePrefix 与你的 Ember 项目所在的文件夹同名。
在我的 emberjs
中 - 我正在实施 firebase
数据库。为此,我更改了 environment
设置,如下所示:(请参阅我的评论)
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)`
这里有什么问题?如何解决这个问题?任何人都请帮助我。
提前致谢。
我怀疑你的firebase与你的错误无关。通过给 module-prefix
一个不正确的名称,我可以在我自己的应用程序上重现您的错误。您是否可以在您的 firebase 项目而不是 ember 项目之后命名您的 module-prefix
?如果是这样,我认为这可能是原因。我想你需要你的 modulePrefix 与你的 Ember 项目所在的文件夹同名。