Puppeteer 16.1.1 not working with chrome-aws-lambda 10.1.0 version

1k Views Asked by At

I am using puppeteer and chrome-aws-lambda to generate pdf in AWS Lambda, till recently it was working with nodejs 12.x, puppeteer v13.7.0 and chrome-aws-lambda v10.1.0.

Recently we updated nodejs to 16.x and puppeteer to 16.1.1 (Got Notification from AWS to update node version.)

Now this functionality has stopped working and I am getting following issue.

error: Error: ENOENT: no such file or directory, mkdtemp 'undefined\\temp\\puppeteer_dev_chrome_profile-XXXXXX' {errno: -4058, code: 'ENOENT', syscall: 'mkdtemp', path: 'undefined\\temp\\puppeteer_dev_chrome_profile-XXXXXX', stack: 'Error: ENOENT: no such file or directory, mkd…ned\\temp\\puppeteer_dev_chrome_profile-XXXXXX'', …}
code:
'ENOENT'
errno:
-4058
path:
'undefined\\temp\\puppeteer_dev_chrome_profile-XXXXXX'
syscall:
'mkdtemp'
message:
'ENOENT: no such file or directory, mkdtemp 'undefined\\temp\\
1

There are 1 best solutions below

0
Rajesh Ramesh On

I too faced the same error with the 10.1.0 versions of puppeteer-core and chrome-aws-lambda running on Lambda Node v16. They worked perfectly fine on Node v14 but not on v16 and v18. So I found an alternate, playwright-aws-lambda which works on Node v16 (tested), not sure of Node v18. There is not much change needed in the codebase for migrating from chrome-aws-lambda to playwright-aws-lambda. The reference for playwright-aws-lambda can be found here