(Created on )

Puppeteer: WebDriver BiDi does not support hasCrossSiteAncestor yet.

BiDi partition-key conversion does not support hasCrossSiteAncestor: true.


BiDi partition-key conversion does not support hasCrossSiteAncestor: true.

Error message

WebDriver BiDi does not support hasCrossSiteAncestor yet.

How this error happens

BiDi’s composite cookie partition-key conversion rejects hasCrossSiteAncestor: true. That partitioning condition cannot be represented by this implementation.

The snippets use a WebDriver BiDi browser named browser.

await browser.defaultBrowserContext().setCookie({
    name: "preference",
    value: "dark",
    domain: "example.com",
    partitionKey: {
        sourceOrigin: "https://example.com",
        hasCrossSiteAncestor: true,
    },
});

How to fix

If the cross-site-ancestor condition is required, perform the cookie operation through Chrome/CDP. Do not change the flag to false merely to suppress the error.

const cdpBrowser = await puppeteer.launch({
    browser: "chrome",
    protocol: "cdp",
});

try {
    await cdpBrowser.defaultBrowserContext().setCookie({
        name: "preference",
        value: "dark",
        domain: "example.com",
        partitionKey: {
            sourceOrigin: "https://example.com",
            hasCrossSiteAncestor: true,
        },
    });
} finally {
    await cdpBrowser.close();
}

Things to keep in mind

The fix uses an imported puppeteer instance and a compatible installed Chrome. The new browser has separate cookies and contexts; migrate only the state your task requires.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →