1
votes

I was working on first application in ember where the versions of handle bars and ember.js were quite old.

I am using bower to install all dependencies. But once I got error in console while running the application, I specified the version of ember.js to 1.8 and that of handlebar to 2.0.0 in bower.json file. But now as the templates were little old I started getting error like 'Unknown template object: function while using handlebars 2.0'. To resolve this error I used steps mentioned here .

But still I get a new error saying Uncaught TypeError: undefined is not a function. Can anyone please suggest how to upgrade the templates now? Or there is some other way round.

3

3 Answers

0
votes

Handlebars 2.0 wasn't supported until Ember 1.9.

0
votes

I had to update a few dependencies mentioned in package.json. - ember-template-compiler of node. The solution mentioned on this link was useful for me.

Thanks

0
votes

In production version handlebars.runtime.js is being used instead of handlebars.js. The runtime version doesn't have Handlebars.compile method. If you are using ember-cli then you can replace new EmberApp(); with

new EmberApp({
   vendorFiles: {
     'handlebars.js': {
       production: 'bower_components/handlebars/handlebars.js'
     }
   }
 });

for reference: http://www.ember-cli.com/#customizing-a-built-in-asset