Hey,
I have a query regarding template compilation and missing keys.
I'm currently building a prototype that uses Handlebars for both client- and server-side templating; one of the concerns I have is the issue of errors due to missing or mis-spelled keys in the context. With Handlebars, such errors are only encountered at runtime when the template is evaluated. A missing key is rendered as an empty string, meaning that such mistakes are often difficult to discern in a page constructed from a number of templates.
Is it possible to evaluate templates in some sort of "strict" mode, or to override the way that evaluation is performed, such that a missing key will cause an error to be thrown? This would make it much simpler to find such problems, especially when a template is being edited by multiple developers.
I found a similar issue, but the proposed solution does not appear to work any longer
#318
Hey,
I have a query regarding template compilation and missing keys.
I'm currently building a prototype that uses Handlebars for both client- and server-side templating; one of the concerns I have is the issue of errors due to missing or mis-spelled keys in the context. With Handlebars, such errors are only encountered at runtime when the template is evaluated. A missing key is rendered as an empty string, meaning that such mistakes are often difficult to discern in a page constructed from a number of templates.
Is it possible to evaluate templates in some sort of "strict" mode, or to override the way that evaluation is performed, such that a missing key will cause an error to be thrown? This would make it much simpler to find such problems, especially when a template is being edited by multiple developers.
I found a similar issue, but the proposed solution does not appear to work any longer
#318