Not able to access "toJS" helper



  • Hello @jan_blaha @bjrmatos

    I'm trying to implement chart in my report and when I'm trying to access {{toJS candidates}} helper. It's throwing an error

    Error: Missing helper: "toJS"
        at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
        at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
        at Object.eval [as main] (eval at createFunctionContext (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:9:102)
        at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:208:32)
        at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:212:12)
        at ret (/app/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:519:21)
        at /app/node_modules/jsreport-handlebars/lib/handlebarsEngine.js:33:20
        at Object.base.apply (/app/node_modules/vm2/lib/contextify.js:469:32)
        at evaluate-template-engine.js:1:64
        at Script.runInContext (vm.js:131:20)
    

    But when I'm making one demo playground it's working fine. Is there any solution for this?

    Thanks!



  • You have an older jsreport version I guess.
    In this case, the approach here may work for you as well
    https://jsreport.net/blog/using-input-data-in-html-page-inline-javascript



  • Got it, Thank you @jan_blaha


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.