我正在使用 Simple-Auth 库构建 Ember-cli 应用程序。当前的系统设置是基本的,仅在初始化程序文件夹中实例化了一个初始化程序。初始化器的名称是
/*initializers/initializer-application.js*/
var ApplicationInitializer = Ember.Application.initializer({
name: 'authentication',
initialize: function(container, application) {
Ember.SimpleAuth.setup(container, application);
}
});
export default ApplicationInitializer;
错误返回无法读取未定义的属性“名称”
更新跟踪
Uncaught TypeError: Cannot read property 'name' of undefined commandcenter.js:54876
Ember.Application.reopenClass.initializer commandcenter.js:54876
(anonymous function) commandcenter.js:58229
default commandcenter.js:58226
(anonymous function) commandcenter.js:110
requireModule commandcenter.js:54
(anonymous function)
感谢您的帮助,如果需要更多信息,一定会提供。
更新 2
;(function() {
define("ember/load-initializers",
[],
function() {
"use strict";
return {
'default': function(app, prefix) {
var initializersRegExp = new RegExp('^' + prefix + '/initializers');
Ember.keys(requirejs._eak_seen).filter(function(key) {
return initializersRegExp.test(key);
}).forEach(function(moduleName) {
var module = require(moduleName, null, null, true);
if (!module) { throw new Error(moduleName + ' must export an initializer.'); }
app.initializer(module['default']);
});
}
}
}
);
})();
var module = require(moduleName, null, null, true);
//Is returning module.default = undefined