Puppeteer: Timed out after waiting {value}ms
A timed Puppeteer observable wait exceeded its deadline.
A timed Puppeteer observable wait exceeded its deadline.
Error message
Timed out after waiting {value}ms
{value} is replaced by the value shown in your error message.
How this error happens
A response wait needs a matching response within its deadline. If you register it after the request already finished, there may be no future response to observe.
The snippets use an open Puppeteer page named page.
await page.goto(
"https://example.com/"
);
await page.waitForResponse(
(response) => {
return response.url() === "https://example.com/";
},
{
timeout: 500,
}
);
How to fix
Register event-based waits before the action that produces the event.
const waiting = page.waitForResponse(
(response) => {
return response.url() === "https://example.com/";
},
{
timeout: 5000,
}
);
waiting.catch(() => { });
await page.goto(
"https://example.com/"
);
const response = await waiting;
console.log(response.status());
Things to keep in mind
A response matching the same URL could occur again on some sites. The failing example assumes no later matching request. Check status and application data, not only the URL.