Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initializers throwing error: Uncaught ReferenceError: module is not defined

I am having trouble with ember-cli 0.0.28. All my initializers are failing to load. I am getting the following error.

Uncaught ReferenceError: module is not defined

The error is thrown for every jshit.js file that is created for each initializer.

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.

Anyone have an idea of what might be causing this. Should I open a bug?

like image 759
Aaron Renoir Avatar asked Oct 01 '22 18:10

Aaron Renoir


1 Answers

I fixed the problem by adding .es6 extension to initializer files

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.

Working from ember-cli master and reverting broccoli-JSHint to v0.4.0 fixes the issue.

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

EDIT

Issue resolved.

like image 175
Aaron Renoir Avatar answered Oct 16 '22 16:10

Aaron Renoir