Puppeteer: Could not find DevToolsActivePort for {value} at {value}
Connecting by channel cannot find the running profile's DevToolsActivePort file.
Connecting by channel cannot find the running profile’s DevToolsActivePort file.
Error message
Could not find DevToolsActivePort for {value} at {value}
{value} is replaced by the value shown in your error message.
How this error happens
Connecting by Chrome channel reads DevToolsActivePort from that channel’s profile. If Chrome is not running with an accessible debugging endpoint there, the file is missing.
The snippets use the imported puppeteer instance. The failing case assumes the profile file has the problem described above.
const browser = await puppeteer.connect({
channel: "chrome",
});
A normal user-visible Chrome window does not automatically provide a Puppeteer debugging endpoint.
How to fix
Let Puppeteer launch a dedicated automation browser instead of discovering an unavailable or corrupt endpoint in a system profile.
const browser = await puppeteer.launch({
browser: "chrome",
});
Things to keep in mind
If you must attach to an existing managed browser, use its actual browserWSEndpoint or browserURL. Do not write guessed ports or browser IDs into DevToolsActivePort, and do not reuse your personal profile for automation.