That does appear to fix the issue. Not sure why this just started happening.
If this in fact the solution, I think the tip/howto on at the bottom of https://jsreport.net/learn/handlebars might need to be updated.
Posts made by charlietilt
-
RE: Missing Helper
-
RE: Missing Helper
Actually, I think I may have figured this one out but not sure. If I remove the first line
var handlebars = require('handlebars');
in theglobal_helpers.js
it appears to work again. I think this is because there is ahandlebars
var already exposed globally and the code I have above is overwriting it and attaching the helpers to the new instance. -
Missing Helper
I have seen this issue discussed and resolved in other posts but I have tried everything that I have read and I am still getting the error
Error occured - Error during rendering report: Missing helper: "isnt"
I have aglobal_helpers.js
asset created with theshared helpers attached to each template
checked.
The content of myglobal_helpers.js
is as follows:var handlebars = require('handlebars'); var HandlebarsIntl = require('handlebars-intl'); HandlebarsIntl.registerWith(handlebars); var helpers = require('handlebars-helpers')({ handlebars: handlebars });
My template is as follows: (engine: handlebars, recipe: html)
{{#isnt 'foo' 'bar'}}Some random text{{/isnt}}
When I try to run this, I get the following error:
Error occured - Error during rendering report: Missing helper: "isnt" Stak - /Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); ^ Error: Missing helper: "isnt" at Object.<anonymous> (/Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13) at Object.eval [as main] (eval at createFunctionContext (/Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:88) at main (/Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32) at ret (/Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12) at ret (/Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21) at /Users/charlie/Code/jsreport/node_modules/jsreport-handlebars/lib/handlebarsEngine.js:25:14 at evalmachine.<anonymous>:1:41 at ContextifyScript.Script.runInContext (vm.js:59:29) at ContextifyScript.Script.runInNewContext (vm.js:65:15) at Object.runInNewContext (vm.js:135:38)
Then strange thing is that this was working yesterday and just stopped working today.
Any thoughts?Thanks,
Charlie