-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download event not caught and always times out #27
Comments
I am also seeing same timeout error when running in lambda. TimeoutError: Timeout while waiting for event "download"
|
I feel the issue is more with the packaged version of chrome with this library. For now, I switched to the new docker container functionality with lambda and able to process the downloads without any issue. |
Amazing. Are you doing it via Serverless or bare lambda? Can you guide me through the process or share some code snippet? Thank You. |
Wow, I am also interested. Can you please guide us through the process or share some code snippet? |
Awesome, it would be great if you could guide us here. Thanking you in anticipation. |
Here is the example I put together for the playwright running in a lambda docker container. |
Thanks a lot @Madhu1512 for going through the effort of creating an example for us. |
can you pls update chromium |
Hi All ! any news ? i'm stucked with this error... aws lambda of course, nodejs > 16 runtime Here's my package.json :
i've tried to downgrade Playwright-core to the suggested 1.2.0 but then i need to refactor all the code since the locator not exist in such old version... Any suggestion ? what i need to achieve is to save the downloaded file to /tmp/ so i cant parse it ( is a Csv) later on. finally, there's the code ( locally works flawless) ` const extractData = async () => {
} module.exports = { extractData } |
I was able to work around this issue by fixing a /tmp folder for the chrome to output its temporary files, then watch the directory for the PDF to arrive. Obviously not perfect for every situation, but works well for us when the PDF download is reliable and only will be one download per session. For example:
|
Hi Samloy, I have use tmp folder in the past for other thing in lambda functions to store temperature files. In this case do you have to pre create the folder every run or added to your source code in AWS Lambda? Or it was enough just with this snippet above? Many thanks for your suggestion and help. Regards |
@SamLoy Very good idea, I successfully ran playwright-aws-lambda in vercel and then downloaded the file |
Thanks a bunch for creating this awesome package.
I was having an issue with the download event. It works great when I try to execute my code locally (
serverless invoke local
) but when I deploy this viaserverless deploy
, thewaitForEvent('download')
times out.Here's the code:
Here's the openWebpage function:
A similar issue was posted in playwright's official repo here.
In that same issue, I've commented about my issue as well, here.
I guess since this package was created based on chrome-aws-lambda, which is for puppeteer basically, and puppeteer does not support download event, so it wasn't included in this package as well. But that's just a random guess. I'd love to help in any way to get this issue fixed.
Hope to hear from you soon.
The text was updated successfully, but these errors were encountered: