抛出错误的初始化程序:未捕获的ReferenceError:未定义模块

Aar*_*oir 5 javascript ember.js

我在使用ember-cli 0.0.28时遇到了麻烦.我的所有初始化程序都无法加载.我收到以下错误.

未捕获的ReferenceError:未定义模块

为每个初始值设定项创建的每个jshit.js文件都会引发错误.

例:

 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
Run Code Online (Sandbox Code Playgroud)

这是在从ember-cli 27升级到ember-cli 0.0.28-master-cbd7c7c264之后开始的.

任何人都知道可能导致这种情况的原因.我应该打开一个bug吗?

Aar*_*oir 4

我通过向初始化文件添加 .es6 扩展名解决了该问题

改变:

 fp-mobile/initializers/authentication.js
Run Code Online (Sandbox Code Playgroud)

到:

 fp-mobile/initializers/authentication.js.es6
Run Code Online (Sandbox Code Playgroud)

我想我会提交一个错误。

编辑这并不能真正解决问题,它只是从构建中删除了初始化程序。jshint 的实现仍然存在一些问题。

从 ember-cli master 工作并将 broccoli-JSHint 恢复到 v0.4.0 修复了该问题。

https://github.com/stefanpenner/ember-cli/issues/782

编辑

问题解决了。