Open Natetronn opened 10 months ago
Okay, set it up locally and now I see I'm getting the following console error:
TypeError: Handlebars.partials[templateName] is not a function
at Object.transformResponse (client-side-templates.js:20:53)
at htmx.org@latest:1:40641
at htmx.org@latest:1:25128
at te (htmx.org@latest:1:4348)
at w (htmx.org@latest:1:25103)
at Sr (htmx.org@latest:1:40621)
at m.onload (htmx.org@latest:1:38101)
Hmm, maybe I'm using an older version somehow? Okay, looks like it:
I can confirm the following update does indeed fix the problem (I ran a local version to test it) https://github.com/russ4stall/htmx/commit/c2d4ea6d889c49fdba051a840a5148b0824b6512
https://github.com/bigskysoftware/htmx/issues/801
Doesn't appear to have made its way in htmx proper, however: https://github.com/bigskysoftware/htmx/blob/master/src/ext/client-side-templates.js
I also ran into this problem. I would appreciate this gets fixed and released, see Pull Request #1836.
On the off chance I'm not just an idiot and it's a bug, am I doing Handlebars client side templates correctly? I have the following template:
Instead of the
hx-target
being replaced with what you'd expect (1 and 1 and delectus aut autem and false
), it's being replaced with the json object itself:{ "userId": 1, "id": 1, "title": "delectus aut autem", "completed": false }
You can see it in action over at jsbin