bun
bun copied to clipboard
Puppeteer can't close the browser: "pid must be a positive integer"
What version of Bun is running?
1.0.26+c75e768a6
What platform is your computer?
Linux 6.7.3-arch1-1 x86_64 unknown
What steps can reproduce the bug?
launch puppeteer and try to close the instance
import puppeteer from "puppeteer";
const browser = await puppeteer.launch({
headless: false,
});
const page = await browser.newPage();
await page.goto("https://bun.sh/");
await page.screenshot({ path: "example.png" });
await browser.close();
What is the expected behavior?
Instance closing correctly
What do you see instead?
error: Puppeteer was unable to kill the process which ran the browser binary. This means that, on future Puppeteer launches, Puppeteer might not be able to launch the browser. Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed. If you think this is a bug, please report it on the Puppeteer issue tracker.
Error cause: RangeError: pid must be a positive integer
Additional information
My guess is that the browser instance isn't getting the browser PID, maybe because of some node API that puppeteer uses?
Any update?
process.kill(-pid)
(negative pid) is a way to eliminate a group of (children, datached) processes.
same issue for bun 1.1.7