jQuery upgrades to 1.12 but existing Ember apps crash

Abhilash L R
Developer Paradise
Published in
1 min readJan 9, 2016

Recently there was an upgrade to jquery library version 1.12. It sent existing ember apps to crash on new build.

Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1 ember-testing.js:1159

Uncaught TypeError: $ is not a function

The reason being ember-cli creates bower.json for you when you run “ember new myapp”. And the bower.json has a version marked for jquery as “^1.11.3" which led to upgrading of jquery while doing a bower install or rather a CI travis build. Since it upgraded to 1.12, a hard coded check to detect if the version is 1.7–1.11 or 2.0 and 2.1 caused the error to occur.

assert(’Ember Views require jQuery between 1.7 and 2.1’, jQuery && (jQuery().jquery.match(/^((1\.(7|8|9|10|11))|(2\.(0|1)))(\.\d+)?(pre|rc\d?)?/) || Ember.ENV.FORCE_JQUERY));

Currently the fix is to lock down your jQuery version in bower.json to 1.11.3 until there is an update from the ember-cli team to set it up properly in bower.json.

--

--

Abhilash L R
Developer Paradise

Loves to travel, writes about programming, photography, life lessons and sometimes cooking