0

I am generating a pdf using a html-to-pdf package, it works on local but doesn't work on deployment using AWS App Runner.

code:

html_to_pdf.generatePdf(file, options).then(pdfBuffer => {
     fs.writeFileSync(path.join(appDir, 'invoice.pdf'), pdfBuffer)
 }).catch(err => {
     console.log('error writing invoice.pdf')
     console.log(err)
 })

error received in cloudwatch:enter image description here

Based on my understanding html-to-pdf package uses a puppeteer and should be installed on app runner. How can I resolve this? I checked the documentation given on logs (https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md) particularly on setting up chrome linux sandbox but I have no idea how to start.

Justin Herrera
  • 526
  • 4
  • 11

0 Answers0