mardi 21 mars 2017

Ember 2.11+ can't find `ember-template-compiler` after removing ember from bower

Since Ember version 2.11, it should be possible to remove ember from bower, and instead load the library using the npm ember-source module.

I've run npm install --save-dev ember-source. I've removed ember from the bower.json file, and run rm -rf bower_components/ember. I've added ember-source to packages.json and installed it .

When I run ember serve, it fails with this message:

Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
Error: Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Class.included (path/to/myapp/node_modules/ember-cli-htmlbars-inline-precompile/index.js:48:20)
    at Class.superWrapper [as included] (path/to/myapp/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:34:20)
    at EmberApp.<anonymous> (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:495:15)
    at Array.filter (native)
    at EmberApp._notifyAddonIncluded (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:490:45)
    at new EmberApp (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:140:8)

It looks like ember is trying to load ember-template-compiler from the bower module, which no longer exists. How can I tell ember that it should instead be looking for node_modules/ember-source/dist/ember-template-compiler.js?




Aucun commentaire:

Enregistrer un commentaire