From 9835b4fd75a672fbf4eff6fde6f1fac630fda40f Mon Sep 17 00:00:00 2001 From: Patrick Kranz Date: Thu, 30 Apr 2026 08:52:34 +0200 Subject: [PATCH] Fix ReferenceError: process is not defined when in browser --- src/utilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities.ts b/src/utilities.ts index 4442b5d..85b0ee2 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -225,11 +225,11 @@ export function getChildNodes(node: HtmlNode | Node): (Node | HtmlNode)[] { } export function perfStart(label: string) { - if (process.env.LOG_PERF) console.time(label); + if (typeof process !== 'undefined' && process?.env?.LOG_PERF) console.time(label); } export function perfStop(label: string) { - if (process.env.LOG_PERF) console.timeEnd(label); + if (typeof process !== 'undefined' && process?.env?.LOG_PERF) console.timeEnd(label); } // endregion