Open mithundas79 opened 4 years ago
@mithundas79 If the problematic line is indeed what you are saying (browser = await chromium.puppeteer.launch({...
) then most of the code you are showing us is likely to be irrelevant. My guess would be that you are having a configuration error / missing dependency, and you cannot launch the browser. That's all.
If that is not the case, please reduce your example because it has too many moving parts.
Hard-code the HTML as a plain string in the JavaScript code. Get rid of everything specific to the Lambda and write the PDF directly to disc by passing a path: '/tmp/myexample.pdf',
to the await page.pdf({...})
call. We must be able to test everything locally and without sam
.
If that still doesn't reveal where the problem is, try eliminating as much of the HTML and the JavaScript code as possible.
Long story short: Please try to make your example minimal.
Environment
chrome-aws-lambda
Version: 5.2.1puppeteer
/puppeteer-core
Version: 5.2.1Expected Behavior
Should create pdf
Current Behavior
I get error
Steps to Reproduce
Possible Solution
I checked the createHtml, and uploadToS3 functions separately they works as normal.... but htmlPdf fails. Specifically it fails at