Skip to content

compile() should throw an error if it reaches a helper fn that is not registered #302

Closed
@CnovakChromeRiver

Description

@CnovakChromeRiver

I was debugging some templates another dev wrote which were not working. He was prototyping with Handelbars for proof of concept and to see how it worked. His custom block helper was not working. We read through the docs and looked for JS errors in the console (there were none) and attempted to debug what was going on.

After a while, I noticed he had placed his registerHelper() call after his compile() call to the source template. I suggested moving registerHelper() above the compile() assuming that the helper was not available when compile() fired. It instantly fixed everything.

The problem is, Handlebars didn't throw an error like "helper function 'list' is not registered." Instead, Handlebars silently handled the error, which was not helpful for debug purposes. Please throw errors when Handlebars encounters one, thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions