-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Object #<Object> has no method 'merge' on version 1.0.12 #547
Comments
What version of handlebars-runtime? |
Getting the same via grunt-contrib-handlebars. For me, that was pre-compiling with 1.0.12 and using 1.0.0 on the frontend. See gruntjs/grunt-contrib-handlebars#55 Seems to be something introduced in 1.0.12 as 1.0.11 still works. |
@w33ble can you post a jsfiddle that demonstrates this? |
or other publicly accessible resource :) |
1.0.12 -> https://gist.github.com/5698906 https://gist.github.com/w33ble/5698906#file-templates-js-L7 is the offending line in the former
Became
|
This is an expected change which unfortunately requires that you use 1.0.0 final runtime on the client. What does |
I'm using 1.0.0-rc4. The Bower repo is behind :( Grabbed 1.0.0 from the website and it does indeed work. I messed up when I tested that before. Thanks! |
Ok cool. I've reached out to the guys who maintain the components/handlebars.js repo to try to get access to that so I can push to it as part of my release process. Related: We've had a thread on versioning internally and our goal is to not introduce any more breaking changes between the runtime and the precompiler until version 2.0 and by that time we will hopefully have a much more automated way of pushing all of these out so there aren't as many places where the version numbers can lag. |
Sounds good to me ;) This is just the result of a bad combination of timings I suppose. Had I just installed a fresh version of grunt-contrib-handlebars, or had Bower been updated, or if I was just grabbing libraries from websites, this wouldn't have even come up. That's just how she goes I guess. Thanks for being on top of the issue though, it's appreciated. |
We do include the dist file in the npm package. I'm moving my day-job On Mon, Jun 3, 2013 at 10:35 AM, Joe Fleming [email protected]:
|
What's going on with this issue? What's the resolution? It's been blocking me for a few weeks now and I don't have time to shave yaks with workarounds. The additional issue of the bower version being out of date seems to be making matters worse. |
@erichiggins use this with the 1.0.12 version of the precompiler and it should work. |
Thanks @kpdecker. I tried that and it didn't make any difference. |
Can you put up a jsfiddle demonstrating the failure? On Sun, Jun 23, 2013 at 6:51 PM, Eric Higgins [email protected]:
|
Unfortunately, no. The codebase is proprietary, and I don't have time to chop it up into a reasonable fiddle. The compilation step is handled by grunt-contrib-handlebars, but because Handlebars is inconsistent in it's versioning ( |
I believe that is >= 1.0.10. https://github.com/wycats/handlebars.js/blob/master/release-notes.md has On Sun, Jun 23, 2013 at 7:01 PM, Eric Higgins [email protected]:
|
Ok, so here's what I've got then (thanks for that debug tidbit):
And
Still no dice. It's good to hear that the versioning is being resolved. So, what's the state of 1.0.12 then? Is it considered broken as-is? Can more tests be added to avoid these types of issues in the future? Thanks for the quick turnaround on providing assistance, though I'd really love to get the issue resolved so I can get back to work. |
1.0.12 is considered working correctly as it passes all of the unit tests and we only have your report of being broken after version numbers are synced. I can't really help you debug this without actually seeing the output that you have. You can't pull out one template's precompiled output? The versioning requirement is listed as a line item in the release notes: https://github.com/wycats/handlebars.js/blob/master/release-notes.md#v1012--100---may-31-2013 |
All of the templates are precompiled into one file. If it helps, here is the line where the error occurs:
Which throws |
That looks like 1.0.12 proper output. And what are the contents of Also can you confirm that at runtime |
Using a breakpoint,
|
How are you calling your templates? Do you ever "reconstitute them" with the |
I'm using Marionette 1.0.3, which I've swapped out the default renderer with the following:
|
You need to use Would need to do something like:
If you want to use the render above. |
Hmm, I wonder if something else had changed (in my code) which removed that snippet... Anyway, I'll give that a shot. Thanks for the help! |
For bower installs that broke, the issue is in the handlebars bower component repo. It's still referenccing old dependency versions. Sent a pull request to fix it. |
Any one know what is happening with this? I am running dev2.0 and get this. I have [email protected] I thank you kindly. |
So i was able to temporarily solve the issue by replacing all encounters of line helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; with helpers = helpers || Handlebars.helpers; data = data || {}; as suggested by @w33ble Is there a better solution to this? |
@luisjotapepe You need to match your precompiler and runtime versions. Precompiler of 1.0.12 and runtime of 1.0.0. |
This is still happening with I can fix by using the command line utility for each template but it's quite laborious, i'd rather this be automated with grunt. |
@adamwaite I'd raise this issue with the grunt-contrib-handlebars project directly, it sounds like there is still a version mismatch if that is what you are seeing. |
Same problem with gulp-handlebars. |
@EdenCore, if you can create a publicly accessible test case, preferable in jsfiddle or jsbin and file a new bug I can take a look. I suspect that there are unexpected versions on one side or the other. |
@kpdecker sorry, I'm afraid I can't find a time for this in the near future. Right now I'm compiling my templates on the server side. Will try to reproduce this problem when I'll rewrite this part of code. |
1.0.11 works.
I'm using hbsfy (which uses handlebars-runtime) & browserbuild. When I try to invoke a template function, I get Uncaught TypeError: Object # has no method 'merge'.
Here is the compiled function:
The text was updated successfully, but these errors were encountered: