puppeteer: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!
Minimal, reproducible example
const browser = await puppeteer.launch({
headless: true,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
Error string
Error: Timed out while waiting for the WS endpoint URL
Bug behavior
- Flaky
Background
Using it inside docker image. Platform / OS version: Rocky Linux 8 running on GCP
I have tried multiple things
- running
node node_modules/puppeteer/install.jsmanually inside docker image. - verify all the dependencies are present for chrome with the help of
ldd chrome
Expectation
Get the browser instance
Reality
It throws error
TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!
at ChromeLauncher.launch (/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:153:23)
Puppeteer version
20.8.2
Node version
18.16.0
Package manager
npm
Package manager version
9.5.1
Operating system
Linux
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 16
- Comments: 28 (1 by maintainers)
Adding timeout while launching the puppeteer will solve this issue. Try adding
timeout:0in launch options.This issue was very troublesome for me. It would proceed normally, but occasionally the error would occur again. So, I added the following code before the page.goto and was able to resolve the problem:
page.setDefaultNavigationTimeout(0);Same issue, however, I will note that adding
timeout: 0as @rohinthr suggested, seems to solve it so far, however, I still need to do more testing to confirm.On
puppeteer v 21.1.1. Using google cloud function gen2onObjectFinalizedtrigger with 16GiB memory, 4 cpu, and 120 second timeout.On first, and intermittently on subsequent runs of this Cloud Storage trigger function, I am getting
TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!. So, this is still very much an issue and unless someone can point out in my code something I’m missing, I am waiting for the browser to close before the function completes, etc.In
package.jsonI had to add:And then at root of project I added the
.puppeteerrc.cjs config file:Puppeteer code:
is anyone can find solution ?
Bump: Running into this timeout problem too. edit: Removing the headless property seems to have fixed this issue but im a bit confused as to why.
I encountered the same error because I was trying to load an extension with an invalid path. Double-checking the path to the extension fixed the issue for me. Hope this helps anyone facing the same problem!
Just solved this issue on my side.
I am running my app on a Ubuntu VPS and I was missing some packages
Just followed this article: https://ploi.io/documentation/server/how-to-install-puppeteer-on-ubuntu
Cheers