Puppeteer: PipeTransport is closed.
A message is sent to an already closed pipe transport.
A message is sent to an already closed pipe transport.
Error message
PipeTransport is closed.
How this error happens
Pipe transport stops being usable when its connection is closed. Reusing a page after disconnecting a pipe-connected browser sends work through a dead connection.
The snippets use the imported puppeteer instance.
const browser = await puppeteer.launch({
pipe: true,
});
const page = await browser.newPage();
browser.disconnect();
await page.title();
How to fix
Finish page work before closing the owned browser. Keep the connection live for the full task.
const browser = await puppeteer.launch({
pipe: true,
});
try {
const page = await browser.newPage();
const title = await page.title();
console.log(title);
} finally {
await browser.close();
}
Things to keep in mind
The public call can report a session-closed or connection-closed error before reaching the pipe guard. A disconnected page cannot reopen that pipe; reconnect deliberately if the browser is externally managed.