From 123f64dc0198ef576cae7e75bc02f2742c527d93 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Mon, 13 Oct 2025 23:13:29 -0700 Subject: [PATCH] fix: random things trying to run with deno and bun (they dont work) --- lib/log/stack.ts | 12 ++++++++++-- run.js | 10 ++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/log/stack.ts b/lib/log/stack.ts index e92f3273add9e50e48e60e9f7ef6498002b9b865..72c5f5da183f19eef47a6a21908d72500a373f0a 100644 --- a/lib/log/stack.ts +++ b/lib/log/stack.ts @@ -251,9 +251,10 @@ function getPackageRoot(absPath: string) { const process = globalThis.process; if (!fs || !path || !process) return null; + const isNodeBuiltin = absPath.startsWith("node:"); if ( "Bun" in globalThis && - (absPath.startsWith("node:") || absPath.startsWith("internal:")) + (isNodeBuiltin || absPath.startsWith("internal:")) ) { return [ `https://github.com/oven-sh/bun/blob/bun-v${process.versions.bun}/src/js/`, @@ -261,7 +262,14 @@ function getPackageRoot(absPath: string) { absPath.replace(":", "/") + ".ts", ]; } - if (absPath.startsWith("node:")) { + if (isNodeBuiltin) { + if ("Deno" in globalThis) { + return [ + `https://github.com/denoland/deno/blob/v${process.versions.deno}/ext/node/polyfills/`, + "", + absPath.slice(5) + ".js", + ]; + } return [ `https://github.com/nodejs/node/blob/${process.version}/lib/`, "", diff --git a/run.js b/run.js index adc7d9ec7d3a3873b8ded5a3dadac630b65fae5a..f93c2ad28d2af0e0768c2d7b8f6616ad667f072e 100644 --- a/run.js +++ b/run.js @@ -54,12 +54,10 @@ process.on("uncaughtException", (error) => { }); if (fs.existsSync(".env")) { - const env = fs.readFileSync(".env", "utf-8").split("\n").map((x) => - x.trim().split("=") - ); - for (const [k, v] of env) { - process.env[k] = v; - } + const env = fs.readFileSync(".env", "utf-8") + .split("\n").filter(Boolean) + .map((x) => x.trim().split("=")); + for (const [k, v] of env) process.env[k] = v; } // Load with hooks -- 2.54.0