(Created on )

Puppeteer: Failed to create a DevTools Page for target (id = {value})

A DevTools target did not finish becoming an initialized Puppeteer page.


A DevTools target did not finish becoming an initialized Puppeteer page.

Error message

Failed to create a DevTools Page for target (id = {value})

{value} is replaced by the value shown in your error message.

How this error happens

A DevTools target did not finish initialization as a Puppeteer page. This is an internal initialization or registry check, not an application input validator.

Use a running Chrome/CDP browser named browser. The following is a lifecycle race to rule out.

await Promise.all([
    browser.newPage(),
    browser.close(),
]);

Creation and shutdown overlap in this example. Depending on event order, Puppeteer may report a target/session-closed error instead. It is not a deterministic reproduction of this particular registry message.

How to fix

Keep the browser and context alive until creation and page work finish. Run the corrected sequence with a fresh live browser.

const page = await browser.newPage();

try {
    await page.setContent(
        "<p>Page task</p>"
    );
} finally {
    await page.close();
}

Things to keep in mind

For a DevTools-specific failure, also reproduce whether devtools: true is necessary or whether an ordinary page works. The lifecycle snippets illustrate ownership; they do not force a DevTools registry failure. Do not edit private target maps.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →