gruntjs / grunt-contrib-handlebars

Precompile Handlebars templates to JST file.
http://gruntjs.com/
MIT License
282 stars 126 forks source link

this.merge is undefined #116

Closed willdady closed 10 years ago

willdady commented 10 years ago

When attempting to use a compiled template I'm getting an "undefined function" error. The culprit appears to be this.merge.

helpers = this.merge(helpers, Handlebars.helpers);

This issue is almost identical to #55. I'm using v2.0.0 of the runtime delivered via bower.

antonjb commented 10 years ago

I was running into this myself but swapped the runtime version to 1.3.0 inside the node_modules that come with grunt-contrib-handlebars. So, this one: grunt-contrib-handlebars/node_modules/handlebars/dist/handlebars.runtime.js.

willdady commented 10 years ago

@antonjb And I assume it worked?

I've given up for now. I incorrectly assumed this would just work with whatever version of the runtime I was using. I guess we have to wait until 2.0 support is added as discussed in #100.

antonjb commented 10 years ago

Oh, yes, sorry, I should've added that using that runtime did solve the problem for me.

stephanebachelier commented 10 years ago

I think it's related to #103 which in fact is related to https://github.com/wycats/handlebars.js/issues/547#issuecomment-29741820

What handlebars version were you using ? Maybe a problem between compiled and runtime versions ?

willdady commented 10 years ago

@stephanebachelier As mentioned. I believe it was a mismatch between the runtime version and the version grunt-contrib-handlebars was using.

Will close this issue.