Puppeteer: Invalid connection options
Internal connection setup received mutually invalid transport/endpoint options.
Internal connection setup received mutually invalid transport/endpoint options.
Error message
Invalid connection options
How this error happens
Connection setup must receive a usable single endpoint source. In a browser-only build, a Node-specific channel lookup is not a supported way to create the transport.
The failing snippet assumes Puppeteer’s browser-only build, not its normal Node.js launcher.
await puppeteer.connect({
channel: "chrome",
});
An empty object or several connection sources usually fails earlier with the “Exactly one” validation. This internal fallback concerns a source that cannot create a transport in the current environment.
How to fix
Provide the actual WebSocket endpoint of a running managed browser.
const browser = await puppeteer.connect({
browserWSEndpoint: "ws://127.0.0.1:9222/devtools/browser/example",
});
Things to keep in mind
Replace the placeholder endpoint with a real browser endpoint. Browser pages also face mixed-content and network-access restrictions. Do not expose a browser debugging endpoint publicly.