Puppeteer: Invalid port '{value}' found
The debugging port parsed from DevToolsActivePort is invalid.
The debugging port parsed from DevToolsActivePort is invalid.
Error message
Invalid port '{value}' found
{value} is replaced by the value shown in your error message.
How this error happens
The port read from DevToolsActivePort must be a usable TCP port. Nonnumeric text, zero, or a value above 65535 fails validation.
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",
});
For example, not-a-port followed by a browser path has the required lines but an invalid port. The connection wrapper can expose this as a nested cause.
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.