-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[BUG] browserContext.newPage() sometimes hangs indefinitely #3939
Comments
You should move |
Good call! With those changes and a |
Closing as this seems to be resolved. Please comment/reopen if the issue persists. |
This was nice general advice about the code shown. But unless I am missing something this issue doesn't quite discuss the expected scenarios when |
Context:
Code Snippet
I'm running a script in Heroku that loops over a number of urls and takes screenshots. Every once in a while (maybe 40% of the time?) the loop will indefinitely hang. I've finally tracked it down to the
newPage
function.A simplified version of my code is something like this:
Describe the bug
I've tried running the script with
process.env.DEBUG='pw:api'
. When combined with lots of console logs, I've found that typically whenawait context.newPage()
runs, this is printed to the terminal:and my script continues as expected.
But sometimes it never prints, never throws an error, and never times out. To be clear, the browser and context both seem to have successfully launched, but the new page doesn't. Sometimes this happens after 10 loops through my script, other times it happens after 1 or 2. Has anyone else stumbled upon something like this?
Many thanks for the amazing work!
Edit to add:
I just tried running again with
process.env.DEBUG='pw:browser'
and when it hangs, I get these warnings after the context has launched:The text was updated successfully, but these errors were encountered: