Branko Gvoka
12/17/2021, 8:41 AMpdfkit
library and esbuild - has anyone had similar problems and solution for this? Thanks!
`Error: ENOENT: no such file or directory, open '/Users/.../pms-integrations-v2/services/hsk/.build/src/cron/data.trie'
https://github.com/foliojs/pdfkit/issues/990
https://stackoverflow.com/questions/67234055/pdfkit-on-js-ts-lambda-with-cdk-error-enoent-no-such-file-or-directory-openRoss Coundon
12/17/2021, 8:50 AMBranko Gvoka
12/17/2021, 2:17 PMpdfmake
 and chrome-aws-lambda
 with puppeteer
 . Issue with both was that I was trying to have code in packages/common, once I moved pdf generator service to services/hsk it worked.
The second one also required adding chrome-aws-lambda
 to bundle externalModules and  'arn:aws:lambda:eu-central-1:764866452798:layer:chrome-aws-lambda:25'
 to layers.
I will go with pdfmake since we already have it in other project. (edited)âFrank
Branko Gvoka
12/18/2021, 3:38 PMRoss Coundon
12/18/2021, 3:39 PMBranko Gvoka
12/18/2021, 3:43 PMNODE_PATH=./src
somehow set in env which was messing things up! đRoss Coundon
12/18/2021, 4:26 PMBranko Gvoka
12/18/2021, 4:28 PMRoberto Salim
04/19/2022, 2:10 AMpdfmake
but I am not sure how to do @Ross Coundonâs suggestion to bundle it and add it to nodeModules property. Is it using serverless-bundle
from the this link?Ross Coundon
04/19/2022, 6:10 AMRoss Coundon
04/19/2022, 6:23 AMexport default function main(app: <http://sst.App|sst.App>): void {
app.setDefaultFunctionProps({
bundle: {
nodeModules: [
'pdfmake'
]
})
...
}
Roberto Salim
04/19/2022, 7:33 AMRoss Coundon
04/19/2022, 7:33 AM