Closed Nogostradamus closed 4 years ago
Maybe use it as any other typeless library as we don't maintain the types currently.
It can get complicated with webpack, because jsreport dynamically reads some files/scripts. Is there a reason for using webpack on the server side?
I'm building AWS lambda function to generate pdf reports. I use cloud formation to setup lambda, roles, and s3 bucket. So my cloud formation script builds js handler using webpack aith packages, and typescript. The output is index.js. That is uploaded as lambda to the AWS.
Hm, you should be able to do it without webpack. Like upload zip with node_modules. In every case, you won't be able to put the whole chrome (puppeteer dependency) to the index.js
Btw we have lambda tutorial here, you likely want a different flow, but still, maybe it can be interesting for you. https://jsreport.net/learn/aws-lambda-serverless
Yes, I saw that kit there and have implemented that manually on AWS with layers. I need to figure out how to do it with the could formation and my company guidelines.
With a minimal example:
I'm able to generate pdf all right. When I try to use it with typescript with webpack I have an error: { "errorType": "TypeError", "errorMessage": "The \"path\" argument must be of type string. Received undefined", "trace": [ "TypeError [ERR_INVALID_ARG_TYPE]: The \"path\" argument must be of type string. Received undefined", " at validateString (internal/validators.js:117:11)", " at Object.dirname (path.js:1128:5)", " at e.exports (/var/task/reporting-engine.js:198:1060)", " at e.exports (/var/task/reporting-engine.js:198:222)", " at Object. (/var/task/reporting-engine.js:198:138)",
" at r (/var/task/reporting-engine.js:1:124)",
" at Object. (/var/task/reporting-engine.js:59:424)",
" at Object. (/var/task/reporting-engine.js:59:17244)",
" at r (/var/task/reporting-engine.js:1:124)",
" at Object. (/var/task/reporting-engine.js:52:2818)",
" at Object. (/var/task/reporting-engine.js:52:3077)",
" at r (/var/task/reporting-engine.js:1:124)",
" at Module. (/var/task/reporting-engine.js:52:3216)",
" at r (/var/task/reporting-engine.js:1:124)",
" at /var/task/reporting-engine.js:1:923",
" at Object. (/var/task/reporting-engine.js:1:934)",
" at Module._compile (internal/modules/cjs/loader.js:1158:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)",
" at Module.load (internal/modules/cjs/loader.js:1002:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:901:14)",
" at Module.require (internal/modules/cjs/loader.js:1044:19)",
" at require (internal/modules/cjs/helpers.js:77:18)"
]
}
My package:
Does anyone use JSreport-core with TS. Can't find any examples.