Puppeteer: Failed to create target for DevTools page (id = {value})
A DevTools page ID cannot be resolved to a target during page creation.
A DevTools page ID cannot be resolved to a target during page creation.
Error message
Failed to create target for DevTools page (id = {value})
{value} is replaced by the value shown in your error message.
How this error happens
A newly created DevTools page ID had no usable target. 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.