Puppeteer: Unsupported frame type
Element geometry calculation cannot obtain a supported parent frame element.
Element geometry calculation cannot obtain a supported parent frame element.
Error message
Unsupported frame type
How this error happens
Element geometry sometimes needs to find the iframe element in its parent frame. If that embedding element is missing or unsupported, Puppeteer cannot translate the child element’s coordinates.
The snippets use an open page. Run the corrected sequence independently.
await page.setContent(
'<iframe srcdoc="<button id=save>Save</button>"></iframe>'
);
const iframe = await page.$("iframe");
const frame = await iframe.contentFrame();
const save = await frame.$("#save");
await page.$eval("iframe", (element) => {
element.remove();
});
await save.click();
How to fix
Reacquire the element from a live supported iframe instead of reusing a handle from a removed frame.
await page.setContent(
'<iframe srcdoc="<button id=save>Save</button>"></iframe>'
);
const iframe = await page.waitForSelector(
"iframe"
);
const frame = await iframe.contentFrame();
await frame.locator("#save").click();
Things to keep in mind
The stale-frame example can fail earlier with a detached-frame message. The exact geometry error requires the parent-frame lookup to return no supported embedding element. If the embedding type itself is unsupported, use a supported browser/frame workflow rather than fabricating coordinates.