The steps to upgrade to ember 1.10 + htmlbars don't work for me at all

I start a fresh project with ember-cli, I follow the steps outlined here Ember.js 1.9.0 and 1.10 Beta Released

rm -rf bower_components
bower install --save ember#beta
bower install
npm uninstall --save-dev broccoli-ember-hbs-template-compiler
npm install --save-dev ember-cli-htmlbars

When I try to use the new block syntax it breaks the build and says:

Build failed.
File: ember2/templates/index.hbs
Parse error on line 2:
...}}{{#each model as |post|}}	<h3>{{post
----------------------^
Expecting 'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'STRING', 'NUMBER', 'BOOLEAN', 'OPEN_SEXPR', 'CLOSE_SEXPR', 'ID', 'EQUALS', 'DATA', 'SEP', got 'INVALID'
Error: Parse error on line 2:
...}}{{#each model as |post|}}	<h3>{{post

When I remove the usage of block params, it does build, but when I try to hit any route in the browser, I get a blank screen and an error saying:

Uncaught Error: Assertion Failed: template must be a function. Did you mean to call Ember.Handlebars.compile("...") or specify templateName instead?

Does anybody know what’s wrong?

EDIT

I was informed on github that there is an additional step not mentioned in the blog, adding this config:

EmberENV: {
  FEATURES: {
    'ember-htmlbars': true
  }
},

It works well now.

4 Likes

@mgenev Can you supply the explanation from github as a link for completeness? Or can someone clarify which file I have to edit to enable html-bars? Would be great!

hey @jessica this was regarding the beta at the time, right now you can simply use Ember 1.12 and soon 1.13 and htmlbars is enabled out of the box

@mgenev I am trying to update my ember-app from 1.8 to 1.12 right now and will get a very similar error as you posted above when starting the server, but you just mentioned that htmlbars should come with ember 1.12 just out of the box. Did I miss adding another specific dependency since I didn’t upgrade gradually but from ember v1.8 directly? Which files would I check first to debug this error?

1 Like