jeudi 28 mai 2015

ember-cli migration: global app module import

I'm having some slight ember-cli migration difficulties with the global application variable.

In project/app/app.js I define App as:

var App;
Ember.MODEL_FACTORY_INJECTIONS = true;
App = Ember.Application.extend({
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver: Resolver
});

Then in a separate controller, project/app/controllers/auth.js, I attempt to access App using the following statement:

import Ember from 'ember';
import App from '../app.js';

This results in an extremely odd error from when running the application. I receive the following error from the Chrome inspector (or Firebug):

Uncaught Error:  Could not find module 'project/app.js' imported 
from 'project/controllers/auth'

At first glance this appears to be a path error in my import statement. However, efforts to fix the path have proven useless. Then I also noticed that the imported portion of the error was not including the correct path either! It should read project/app/controllers/auth but instead reads project/controllers/auth. I'm quite confused as to what's happening here.

Please let me know if I can provide more details at all, thanks so much!




Aucun commentaire:

Enregistrer un commentaire