nknapp / promised-handlebars

Wrapper for Handlebars that allows helpers returning promises
MIT License
47 stars 14 forks source link

Cannot read property 'toHTML' of undefined #39

Open tiholic opened 3 years ago

tiholic commented 3 years ago

Encountered these logs. Unable to find the root cause.

TypeError: Cannot read property 'toHTML' of undefined
    at replacePlaceholdersRecursivelyIn (.../node_modules/promised-handlebars/lib/markers.js:96:31)
    at .../node_modules/promised-handlebars/lib/markers.js:106:22
    at .../node_modules/promised-handlebars/lib/replaceP.js:44:47
    at String.replace (<anonymous>)
    at replaceP (.../node_modules/promised-handlebars/lib/replaceP.js:37:14)
    at replacePlaceholdersRecursivelyIn (.../node_modules/promised-handlebars/lib/markers.js:102:20)
    at .../node_modules/promised-handlebars/lib/markers.js:111:18

PS: Thank you for the work. This package is a great relief!

tiholic commented 3 years ago

Found the root cause: One of my async helpers was returning undefined in one particular scenario.