56

I'm starting with ember. I followed the Getting Started guide at emberjs.com and managed to create a new ember application by running the following commands:

npm install -g ember-cli
ember new sample-app

Everything went successful and I can see the app files generated by ember-cli. Soon after that I did:

ember server

The command line shows:

version: 1.13.13
Livereload server on http://localhost:49153
Serving on http://localhost:4200/

Build successful - 4426ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor                | 3498ms              

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor (1)            | 3498ms 

The problem comes when I go to http://localhost:4200. Nothing gets loaded and the Chrome console is showing the following:

Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1
Uncaught Error: Could not find module `ember` imported from `sample-app/app`

I tried to fix this by reinstalling ember-cli, bower and npm but nothing is working.

Here's additional info in case is necessary:

$ ember -v
version: 1.13.13
node: 5.4.0
npm: 2.14.10
os: darwin x64

$ npm -v
3.5.3

$ bower -v
1.7.2

Help is much appreciated. Thanks in advance!

Daniel B. Lopez
  • 663
  • 5
  • 5
  • Unrelated to your question, but there's a discrepancy between the 'npm' version being reported by ember and npm itself - so make sure you have a clean 'PATH' set up when building via ember and running npm manually - as this will be sure to give you headaches. – colm.anseo Feb 09 '16 at 22:55

1 Answers1

102

This is a bug due to a new version of jQuery which ember is not yet able to handle. For now you can change the following line in your bower.json file. Then run bower install and it should work.

"jquery": "^1.11.3",

to

"jquery": "1.11.3",

A new version of ember.js is imminent which should fix this.

Lawree
  • 1,162
  • 1
  • 9
  • 7
  • 5
    `"^1.11.3"` now resolves to new jQuery version 1.12 (try `bower info jquery` or visit the [jQuery blog](http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/)) That means that [this assertion in Ember](https://github.com/emberjs/ember.js/blob/v1.13.7/packages/ember-views/lib/system/jquery.js#L17) fails. This caused, among other symptoms, our continuous integration builds based on `ember test` to _hang_ (with no error reported). – bargar Jan 11 '16 at 05:41
  • 2
    it is important to restart the server too, at least I needed to. – igrossiter Jan 11 '16 at 19:45
  • 1
    In addition to restarting the server you will need to run `bower update` to get the correct version of jquery. – RyanNerd Mar 04 '16 at 20:39