Since I upgraded to Handlebars 4.7.6 I’m getting an error trying to render my precompiled templates. I upgraded the js runtime to the same version but my template fails to load.
This is the code trying to render the template:
var template = Handlebars.templates.index; var rendered = template(data);
and the error: TypeError: template is not a function
When I inspect the differences in the code of a 4.7.3 compiled template I see that the older versions handles the object creation differently than the newer template. On the beginning of the file the templates are different:
If I manually change ["handlebars.index"] to index then my template renders correctly. But I don’t want manually to change the code of the template every time I compile a new one.
Is there something I can change on my code for making it work?