(Created on )

Puppeteer: Window not found

The BiDi browser window ID is absent from the current client-window list.


The BiDi browser window ID is absent from the current client-window list.

Error message

Window not found

How this error happens

A browser window ID is not permanent. Once its last tab closes, the corresponding client window can disappear from BiDi’s window list.

The snippets use a WebDriver BiDi browser and its page.

const windowId = await page.windowId();

await page.close();

await browser.getWindowBounds(
    windowId
);

How to fix

Read or change window bounds while the window is still alive.

const windowId = await page.windowId();

const bounds = await browser.getWindowBounds(
    windowId
);

console.log(bounds);

await page.close();

Things to keep in mind

The failing example assumes page is the last tab in that window and the browser supports BiDi window APIs. Another tab can keep the window alive. Run the fix with a new live page and obtain its current ID.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →