Puppeteer WebSocket endpoint timeout: diagnose browser startup
Browser startup did not publish the expected WebSocket endpoint before the launch deadline.
Browser startup did not publish the expected WebSocket endpoint before the launch deadline.
Error message
Timed out after {value} ms while waiting for the WS endpoint URL to appear in stdout!
{value} is replaced by the value shown in your error message.
How this error happens
Puppeteer waits for the launched browser to publish its debugging endpoint. A tiny startup deadline can expire before a healthy browser finishes starting.
The snippets use the imported puppeteer instance.
await puppeteer.launch({
timeout: 1,
});
How to fix
Use a realistic startup deadline and enable browser output while diagnosing launch problems.
const browser = await puppeteer.launch({
timeout: 30000,
dumpio: true,
});
Things to keep in mind
One millisecond is deliberately unrealistic, but timing still varies. If a reasonable deadline fails, inspect browser output for missing libraries, profile locks, permissions or a wrong executable. Waiting longer will not repair a crashed process.