Puppeteer: Target that is being activated is missing a CDPSession.
A target becoming primary during activation has no CDP session.
A target becoming primary during activation has no CDP session.
Error message
Target that is being activated is missing a CDPSession.
How this error happens
A target being activated had no CDP session available for the activation step. This is an internal target-activation invariant.
The snippets use an open Chrome/CDP page named page. Run the sequences separately.
await Promise.all([
page.goto("about:blank?next"),
page.close(),
]);
How to fix
Do not tear down the page while navigation or activation is still in progress. Let navigation finish before cleanup.
await page.goto(
"about:blank?next"
);
const title = await page.title();
console.log(title);
await page.close();
Things to keep in mind
This race illustrates competing page lifecycles; a normal navigation does not reliably force a target swap or this exact invariant. If the error persists without cleanup races, reproduce the activation path and isolate plugins or custom auto-attach handling.