(Created on )

Puppeteer: Cannot select unknown device!

The chosen device object is not one of this prompt's known devices.


The chosen device object is not one of this prompt’s known devices.

Error message

Cannot select unknown device!

How this error happens

select checks device object identity within the current prompt. A made-up object is not one of that prompt’s devices, even if its fields look plausible.

The snippets use a live DeviceRequestPrompt named prompt.

await prompt.select({
    id: "example-device",
    name: "Test device",
});

How to fix

Wait for a device from the prompt and pass that returned object unchanged.

const device = await prompt.waitForDevice(
    (device) => device.name.includes("Test device")
);

await prompt.select(
    device
);

Things to keep in mind

A device object from another prompt is also invalid. A prompt with no matching device will time out rather than make the invented object valid.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →