Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

handlebars.js Uncaught TypeError: Object #<Object> has no method 'call'

Anyone help with a problem with handlebars.js?

I'm precompiling the templates using handlesbars running on Centos 6.4. To install this I installed:

  1. npm: yum -y --enablerepo=epel install npm
  2. inherits first to avoid an issue: npm install -g inherits
  3. then handlebars itself: npm install -g handlebars

This gives the following versions:

I'm using requirejs to load the following with the app:

  • jQuery v1.11.0
  • Underscore.js 1.6.0
  • handlebars v1.3.0 (with amd)
  • backbone.js 1.1.0

Does anyone have a set of version numbers that work together?

Thanks!

like image 534
MarkTDev Avatar asked Feb 12 '14 16:02

MarkTDev


1 Answers

It was the version of handlebars on the server. NPM installs the latest by default and the version 2 alpha was causing the issue. Found this fix on Github (https://github.com/wycats/handlebars.js/issues/734):

  1. npm uninstall handlebars -g
  2. npm install [email protected] -g

Seems to work fine now, back to work!

(Thanks Mahesh for the pointer.)

like image 117
MarkTDev Avatar answered Oct 12 '22 23:10

MarkTDev