From b734e1b5d88887e85f13646bd3b7c7b23c1c423e Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Fri, 8 Mar 2024 23:11:14 -0500 Subject: [PATCH] fix(env): Fix regression in isBrowser() check (#253) --- modules/env/src/lib/is-browser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/env/src/lib/is-browser.ts b/modules/env/src/lib/is-browser.ts index 9e7f05a..06c26ab 100644 --- a/modules/env/src/lib/is-browser.ts +++ b/modules/env/src/lib/is-browser.ts @@ -5,7 +5,8 @@ import {isElectron} from './is-electron'; /** Check if in browser by duck-typing Node context */ export function isBrowser(): boolean { - // @ts-expect-error - const isNode = typeof process === 'object' && !process?.browser; + const isNode = + // @ts-expect-error + typeof process === 'object' && String(process) === '[object process]' && !process?.browser; return !isNode || isElectron(); }