(Created on )

Puppeteer: Polling never started.

An internal poller is stopped/read before start created its deferred result.


An internal poller is stopped/read before start created its deferred result.

Error message

Polling never started.

How this error happens

Puppeteer’s internal poller was asked for a result or cleanup before its start operation created the result state. 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.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →