Ember CLI - Uncaught Error: Couldn't find module ember?
I am converting an old school Ember app (built with grunt) to the Ember CLI and I am facing an odd problem that I cannot solve.
When I run the app with Ember serve
and get it in the browser, I get two errors:
Uncaught Error: Could not find module handlebars
Uncaught Error: Could not find module ember
I don't know what to look for as I am importing rudders and ember into Broccoli, presumably with the correct syntax.
Here is mine Broccoli.js
:
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
app.import('bower_components/jquery/dist/jquery.js');
app.import('bower_components/handlebars/handlebars.js');
app.import('bower_components/jquery-validation/dist/jquery.validate.js');
app.import('bower_components/jquery-validation/dist/additional-methods.js');
app.import('bower_components/recaptcha-ajax/recaptcha_ajax.js');
app.import('bower_components/noty/js/noty/packaged/jquery.noty.packaged.js');
app.import('bower_components/d3/d3.min.js');
app.import('vendor/noty/noty-custom-theme.js');
app.import({
development: 'bower_components/ember/ember.js',
production: 'bower_components/ember/ember.prod.js'
});
module.exports = app.toTree();
In my app, I import Ember using standard ES6 syntax:
import Ember from 'ember';
export default Ember.Route.extend({
...
});
This is what the bower list looks like:
application
├─┬ bootstrap-sass-official#3.3.1
│ └── jquery#2.1.1
├── d3#3.4.13
├─┬ ember#1.9.0-beta.4
│ ├── handlebars#2.0.0
│ └── jquery#2.1.1
├─┬ ember-c3#0.1.3
│ ├─┬ c3#0.4.5 (0.4.7 available)
│ │ └── d3#3.4.13
│ ├── ember#1.9.0-beta.4
│ └── handlebars#2.0.0 incompatible with ^1.3.0 (1.3.0 available, latest is 2.0.0)
├─┬ ember-cli-shims#0.0.3
│ └── ember#1.9.0-beta.4
├── ember-cli-test-loader#0.0.4
├─┬ ember-data#1.0.0-beta.12
│ └── ember#1.9.0-beta.4
├─┬ ember-load-initializers#0.0.2
│ └── ember#1.9.0-beta.4
├─┬ ember-qunit#0.1.8
│ ├── ember#1.9.0-beta.4
│ └── ember-data#1.0.0-beta.12
├─┬ ember-qunit-notifications#0.0.4
│ └── qunit-notifications#0.0.3
├─┬ ember-resolver#0.1.10
│ └── ember#1.9.0-beta.4
├── fontawesome#4.2.0
├─┬ fuelux#3.3.1
│ ├─┬ bootstrap#3.2.0 (latest is 3.3.1)
│ │ └── jquery#2.1.1
│ ├── jquery-1.11.0#1.11.0 (latest is 2.1.1)
│ ├── moment#2.7.0 (latest is 2.8.4)
│ └── requirejs#2.1.15
├── handlebars#2.0.0
├── jquery#2.1.1
├─┬ jquery-validation#1.13.1
│ └── jquery#2.1.1
├── loader.js#2.1.1
├── noty#2.3.2
├── qunit#1.15.0
└── recaptcha-ajax#ea58c14d98
I tried:
- Changing the order in which I import things into broccoli (doesn't matter, but worth a try)
- Imports handlebars.runtime instead
- Reinstaling ember-cli with
npm uninstall -g ember-cli && npm cache clear && npm install -g ember-cli#0.12
- no luck ... - Follow the steps here: http://emberjs.com/blog/2014/10/16/handlebars-update.html#toc_ember-cli-steps
Here are the versions:
$ ember version --verbose
version: 0.1.2
http_parser: 1.0
node: 0.10.33
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.29
zlib: 1.2.3
modules: 11
openssl: 1.0.1j
npm: 2.1.3
What's happening?
I also opened an issue with ember-cli: https://github.com/stefanpenner/ember-cli/issues/2636
Any pointers would be greatly appreciated!
Thank!
source to share
It turns out this was a bug in the Ember CLI 0.1.3. I opened a ticket here: https://github.com/stefanpenner/ember-cli/issues/2636
Version 0.1.4 also fails on Windows due to another bug on Windows.
If you run into this, use version 0.1.2 (which works) or try a newer version if it exists when you got into the problem.
source to share