Skip to content

registerHelper breaks with Typescript 4.4 #1767

@Fadorico

Description

@Fadorico

Typescript 4.4 as recently introduced this breaking change: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#more-compliant-indirect-calls-for-imported-functions

This change breaks the registerHelper function, and possibly other functions as well. Taking the following example code:

registerHelper('myHelper', function (value, options) {});

This gets transpiled into the following:

(0, handlebars_1.registerHelper)('myHelper', function (value, options) {});

Which causes the following error:

Cannot read property 'helpers' of undefined
at registerHelper ([...]/node_modules/handlebars/lib/handlebars/base.js:47:12)

This is using the current latest version of Handlebars (4.7.7) and Typescript 4.4.3

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions