(Created on )

Puppeteer: Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to pu...

connect does not receive exactly one supported endpoint/transport/channel option.


connect does not receive exactly one supported endpoint/transport/channel option.

Error message

Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to pu...

How this error happens

connect must know which single connection source to use. Providing both a WebSocket endpoint and an HTTP browser URL is ambiguous.

The snippets use the imported puppeteer instance.

await puppeteer.connect({
    browserWSEndpoint: "ws://127.0.0.1:9222/devtools/browser/example",
    browserURL: "http://127.0.0.1:9222",
});

How to fix

Pass exactly one connection source. Use the HTTP browser URL when you want Puppeteer to discover its WebSocket endpoint.

const browser = await puppeteer.connect({
    browserURL: "http://127.0.0.1:9222",
});

Things to keep in mind

The fix requires a Chrome instance already serving its debugging endpoint on that address. The placeholder WebSocket path in the failing snippet is not a real browser ID.

All Puppeteer errors

Keep Reading

Puppeteer Guides

All Guides →