when I try to load the handlebars-helpers:
const helpers = require('handlebars-helpers');
and then pass it the handlebars as suggested:
jsreport.use(helpers({
handlebars: handlebars
}))
I get a type error on hbs..
module initialization error: TypeError
at /var/task/node_modules/handlebars-helpers/index.js:36:11
at forIn (/var/task/node_modules/for-in/index.js:12:12)
at helpers (/var/task/node_modules/handlebars-helpers/index.js:35:5)
at Object. (/var/task/lib/reporting.js:52:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/var/task/index.js:3:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
how do I add the helpers to the handlebar when it is wrapped by jsreport-handlebars?
I am trying to add the handlebars-helpers. I am using the jsreport-handlebars package.
const handlebars = require('jsreport-handlebars') jsreport.use(handlebars())
when I try to load the handlebars-helpers: const helpers = require('handlebars-helpers'); and then pass it the handlebars as suggested: jsreport.use(helpers({ handlebars: handlebars }))
I get a type error on hbs..
module initialization error: TypeError at /var/task/node_modules/handlebars-helpers/index.js:36:11 at forIn (/var/task/node_modules/for-in/index.js:12:12) at helpers (/var/task/node_modules/handlebars-helpers/index.js:35:5) at Object. (/var/task/lib/reporting.js:52:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/var/task/index.js:3:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
how do I add the helpers to the handlebar when it is wrapped by jsreport-handlebars?
Any example here?