Global helpers not working correctly on azure functions



  • Hello everyone, when I deploy a jsreport on azure functions, sometimes it works, sometimes it doesn't. I am getting Error: Missing helper: "ifCond" but it's defined in global.helper.js.

    0_1645439100471_upload-ae03f3d1-a620-4329-952c-55464451c21d

    Anyone can help with this issue?



  • The helpers should be just functions in the global scope without the Handlebars.registerHelper.

    In your case

    function ifCond(v1, v2, options) {
      .....
    }
    

    If this won't help, please try to share more details.



  • I changed all helpers as you like sent me but still the same issue. Which details do you want to need to fix this issue?
    You can see the error

    Error: Missing helper: "ifCond"
        at Object.<anonymous> (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
        at Object.wrapper (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
        at eval (eval at createFunctionContext (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:11:106)
        at prog (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/runtime.js:268:12)
        at execIteration (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)
        at Object.<anonymous> (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)
        at Object.wrapper (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)
        at eval (eval at createFunctionContext (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:262:23), <anonymous>:11:49)
        at prog (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/runtime.js:268:12)
        at execIteration (/home/site/wwwroot/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)```


  • I'm not sure what could be the reason, don't have a theory. You will need to share as many details as you can.

    The best would be if you can share a minimal repo that replicates the problem.


Log in to reply
 

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