question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dynamic partials cause (lookupProperty(...) || (depth0 && lookupProperty(...)) || alias3).call is not a function

See original GitHub issue

Used versions: express-handlebars: 5.1.0 handlesbars: 4.7.6

partials is saved in: /views/partials/filename.handlesbars varPartial = ‘filename’;

main template uses {{> (varPartial)}}

outcome:

TypeError: (lookupProperty(…) || (depth0 && lookupProperty(…)) || alias3).call is not a function at Object.eval [as main] (eval at createFunctionContext (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:11:148) at main (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:208:32) at ret (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:212:12) at ret (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:519:21) at ExpressHandlebars._renderTemplate (/usr/src/app/node_modules/express-handlebars/lib/express-handlebars.js:253:10) at ExpressHandlebars.render (/usr/src/app/node_modules/express-handlebars/lib/express-handlebars.js:166:21) at async ExpressHandlebars.renderView (/usr/src/app/node_modules/express-handlebars/lib/express-handlebars.js:224:15)

If I use {{> 'filename'}}

It works

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
knownasilyacommented, May 12, 2021

I was able to resolve it. I registered a helper that was defined in an ESM but required, so it didn’t use default.

0reactions
UziTechcommented, May 11, 2021

@knownasilya it would be easier to help if you create a new issue and give more details about the code you are trying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

(depth0 && lookupProperty(...)) || alias3).call is not a function ...
Getting this same error when express-handlebars passes a template to compile to hbs, although I'm not using any partials at all. The code...
Read more >
TypeError: (depth0 || container.hooks.helperMissing).call is ...
I am using a header to be injected as a partial in handlebar. If just products is passsed the page loads ,but when...
Read more >
Partials | Handlebars
Handlebars allows for template reuse through partials. Partials are normal Handlebars templates that may be called directly by other templates.
Read more >
Renovate Bot Package Diff
lookupProperty ||function(e,n){if(Object.prototype.hasOwnProperty.call(e,n))return e[n]};return" {\n name: 'not-to-test',\n comment:\n \"This module depends ...
Read more >
Dentures and Partials - Bay Hill Dental
Bay Hill Dental offers dentures and partials in Pleasant Hill CA. For more information about dentures and partials, call our office today at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found