From 08c49301b7d5a3cca9fbf2dc468e456e725f6455 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sat, 3 Jan 2026 11:19:23 -0800 Subject: [PATCH] Fix isNode detection when process module is used in webpack Fixes #5341 --- src/common/Platform.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/Platform.ts b/src/common/Platform.ts index 4102f20c..7ea0e9c6 100644 --- a/src/common/Platform.ts +++ b/src/common/Platform.ts @@ -14,7 +14,9 @@ interface INavigator { declare const navigator: INavigator; declare const process: unknown; -export const isNode = (typeof process !== 'undefined' && 'title' in (process as any)) ? true : false; +// navigator is also checked here because bundling with the process module can cause issues +// otherwise +export const isNode = (typeof process !== 'undefined' && 'title' in (process as any) && typeof navigator === 'undefined') ? true : false; const userAgent = (isNode) ? 'node' : navigator.userAgent; const platform = (isNode) ? 'node' : navigator.platform;