Error with render
-
Hello, I'm seeing this error when hit the endpoint:
TypeError: jsreport_1.default.render is not a function
this is how I'm calling the render function:
export const convertTemplateToPdf = async (template: string): Promise<JsReportRenderResult> => { const templatePdf: JsReportRenderResult = await jsreport.render({ template: { engine: 'none', recipe: 'chrome-pdf', content: template } }); return templatePdf; };
This is the import statement
import jsreport from 'jsreport';
and this is my package.json dependencies
"dependencies": { "@jsreport/jsreport-freeze": "^3.0.1", "express": "^4.19.2", "jsreport": "^3.13.0", "express-handlebars": "^6.0.7", "pdf-merger-js": "^4.1.0" }
Any thoughts on why I'm getting that error?
Thanks!
-
Look here
https://github.com/jsreport/jsreport-typescript-example
https://github.com/jsreport/jsreport-typescript-example/blob/master/src/stateless.ts