[英]Initializers throwing error: Uncaught ReferenceError: module is not defined
I am having trouble with ember-cli 0.0.28. 我在ember-cli 0.0.28上遇到了麻烦。 All my initializers are failing to load. 我所有的初始化程序都无法加载。 I am getting the following error. 我收到以下错误。
Uncaught ReferenceError: module is not defined 未捕获的ReferenceError:模块未定义
The error is thrown for every jshit.js file that is created for each initializer. 为每个初始化程序创建的每个jshit.js文件都会引发错误。
Example: 例:
define("fp-mobile/initializers/authentication.jshint",
[],
function() {
"use strict";
### This is the line that is blowing up.
module('JSHint - fp-mobile/initializers');
### Uncaught ReferenceError: module is not defined
test('fp-mobile/initializers/authentication.js should pass jshint', function() {
ok(true, 'fp-mobile/initializers/authentication.js should pass jshint.');
});
});//# sourceURL=fp-mobile/initializers/authentication.jshint.js
This started after upgrading from ember-cli 27 to ember-cli 0.0.28-master-cbd7c7c264. 从ember-cli 27升级到ember-cli 0.0.28-master-cbd7c7c264之后,此操作开始。
Anyone have an idea of what might be causing this. 任何人都有可能导致这种情况的想法。 Should I open a bug? 我应该打开一个错误吗?
I fixed the problem by adding .es6 extension to initializer files 我通过将.es6扩展名添加到初始化程序文件来解决此问题
Change: 更改:
fp-mobile/initializers/authentication.js
To: 至:
fp-mobile/initializers/authentication.js.es6
I think I will file a bug. 我想我会提出一个错误。
EDIT This doesn't really fix the issue, it just removes the initializer from the build. 编辑这并不能真正解决问题,只是从构建中删除了初始化程序。 Something is still going on with the jshint implementation. jshint实现仍在进行某些操作。
Working from ember-cli master and reverting broccoli-JSHint to v0.4.0 fixes the issue. 从ember-cli master工作并将西兰花JSHint还原到v0.4.0可解决此问题。
https://github.com/stefanpenner/ember-cli/issues/782 https://github.com/stefanpenner/ember-cli/issues/782
EDIT 编辑
Issue resolved. 问题解决了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.