diff --git a/src/process.ts b/src/process.ts index 8fbee44..c4febdf 100644 --- a/src/process.ts +++ b/src/process.ts @@ -27,7 +27,11 @@ export async function execa(cmd: string[]) { }); // Prevent accidental exit - global.addEventListener("beforeunload", () => { + globalThis.addEventListener("error", () => { + childExit(); + }); + + globalThis.addEventListener("unhandledrejection", () => { childExit(); });