0

I have just installed the latest ember starter kit. It has:

  • Ember.VERSION : 1.0.0-rc.5
  • Handlebars.VERSION : 1.0.0-rc.4
  • jQuery.VERSION : 1.9.1

I am using grunt-contrib-handlebars@0.5.9 to pre-compile my templates (this is the latest version available). I do not know what version of handlebars is included in that package, but I get the following error when starting the application:

Uncaught Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 1.0.0-rc.4) or downgrade your runtime to an older version (== 1.0.0-rc.3).

I have even tried loading another handlebars' runtime (version 1.0.0-rc.3), but ember is not happy about it:

Uncaught Error: assertion failed: Ember Handlebars requires Handlebars version 1.0.0-rc.4, COMPILER_REVISION expected: 3, got: 2 – Please note: Builds of master may have other COMPILER_REVISION values.

So ember needs 1.0.0-rc.4, but there is no grunt precompiler available for this version. Catch-22?

Should I drop pre-compiled templates? Having this break every time I upgrade ember is going to be very annoying ...

blueFast
  • 41,341
  • 63
  • 198
  • 344

2 Answers2

2

You could use the emberTemplates grunt task, from here: https://github.com/dgeb/grunt-ember-templates since this version has the updated dependencies and is maintained from a member of the ember core team.

As I guess you already know, to use the grunt-ember-templates you can define a dependence in your package.json

  ...
  "devDependencies": {
    ...
    "grunt-ember-templates": "0.4.7"
  }
  ...

and run npm install.

Hope it helps

intuitivepixel
  • 23,302
  • 3
  • 57
  • 51
  • That did help. My `package.json` was a bit confusing: it was specifying `grunt-contrib-handlebars` *and* `grunt-ember-templates`. The former was apparently not used, and I got confused. `grunt-ember-templates` is the right one, and upgrading the version solves the problem. – blueFast Jun 16 '13 at 12:02
0

I had the same problem - the same error message. In my case the problem was that I was using an ember library that included some templates compiled by a previous version of grunt-ember-handlebars So I got a new version of that library that was compiled by the current version of grunt-ember-handlebars and that solved the problem.

pcv
  • 2,121
  • 21
  • 25