Missing partials silently render empty: should Handlebars throw an error?
0 reputation · 17 Oct 2020, 09:53 UTC
Missing partials silently render empty strings
In Handlebars, invoking an undefined partial via {{> name}} results in an empty string and rendering continues. This is documented behavior but can mask template bugs.
The current API offers no flag to change this behavior, and global registries mean any change affects all renders.
Key questions: 1) Should Handlebars throw an exception when a partial is missing? 2) Is there a way to enable or disable this behavior per render or globally? 3) What impact would throwing have on existing applications that rely on silent failures?