From 583c66ca3d87da392590848d1ba5b2afea5df43a Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Sat, 27 Apr 2024 13:51:05 +0200 Subject: [PATCH] Fix incompatibilites with Bun --- svr.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/svr.js b/svr.js index 4b84b09..8fe8bd2 100644 --- a/svr.js +++ b/svr.js @@ -940,7 +940,16 @@ function calculateNetworkIPv4FromCidr(ipWithCidr) { }).join("."); } -if (!process.stdout.isTTY && (!inspector || !inspector.url())) { +var inspectorURL = undefined; +try { + if (inspector) { + inspectorURL = inspector.url(); + } +} catch (err) { + // Failed to get inspector URL +} + +if (!process.stdout.isTTY && !inspectorURL) { // When stdout is not a terminal and not attached to an Node.JS inspector, disable it to improve performance of SVR.JS console.log = function () {}; process.stdout.write = function () {};