Puppeteer: Polling stopped
An active poller was stopped before its result completed.
An active poller was stopped before its result completed.
Error message
Polling stopped
How this error happens
A running internal poller was stopped before its condition produced a result. Page teardown can interrupt the wait’s startup or active polling lifecycle.
The snippets use an open page. Run the corrected sequence on a fresh page.
const waiting = page.waitForFunction(
() => document.querySelector("#ready") !== null,
{
polling: "mutation",
}
);
waiting.catch(() => { });
await page.close();
await waiting;
How to fix
Keep the page alive while waiting and let the application reach the required state before cleanup.
await page.setContent(
'<p id="ready">Ready</p>'
);
await page.waitForFunction(
() => document.querySelector("#ready") !== null,
{
polling: "mutation",
timeout: 5000,
}
);
await page.close();
Things to keep in mind
The public wait usually exposes an abort, timeout or detached-frame error rather than the internal poller message. This is a teardown workflow to rule out, not a reliable public trigger for the exact invariant. Do not call injected poller methods yourself.