lundi 20 mars 2017

Ember load-initializers error: Could not find module `ember-load-initializers`

I'm having trouble updating an older Ember app.

I've ported the code into a new, empty ember app and installed the dependencies. I get no error when I serve the app, but when I inspect the browser console, I see that the app failed to launch.

Uncaught Error: Could not find module `ember/load-initializers` imported from `<my-app>/app`

I've seen a similar SO post that suggested this was caused by issues with ember-cli and jquery. link

However, that post is over a year old and I'm running an up-to-date version of ember along with an newer jquery library. Sure, it's no guarantee, but it seems a bit unlikely that this is still an issue for ember-cli.

My app/app.coffee file is pretty basic (no additions)

`import Ember from 'ember'`

`import Resolver from 'ember/resolver'`

`import loadInitializers from 'ember/load-initializers'`

`import config from './config/environment'`

Ember.MODEL_FACTORY_INJECTIONS = true

App = Ember.Application.extend
  modulePrefix: config.modulePrefix
  podModulePrefix: config.podModulePrefix
  Resolver: Resolver


loadInitializers(App, config.modulePrefix)

`export default App`

From the console, I can verify that my app is using the expected jquery version: $ Ember.$.fn.jquery "3.2.0"

However, from the command line, I get a different version. $ bower jquery -v 1.8.0 I'm not sure whether that's meaningful or a red herring.

At any rate, my ember-cli is fairly recent. ember-cli: 2.12.0

I've added links to the package.json and bower.json files, in case they contain any clues.

At this point, I'm not really sure how to troubleshoot the issue. The depency




Aucun commentaire:

Enregistrer un commentaire