From dcd3a6a5cd4eacbb3273c98e54623ced1633348d Mon Sep 17 00:00:00 2001 From: blurfx Date: Thu, 18 Apr 2024 01:40:58 +0900 Subject: [PATCH] Fix issue of referencing process object on browser --- src/devtools/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devtools/index.ts b/src/devtools/index.ts index 62e548c10..6d67e6f8f 100644 --- a/src/devtools/index.ts +++ b/src/devtools/index.ts @@ -99,7 +99,10 @@ export function setupDevtools( doc: Document, ): void { // NOTE(hackerwins): For production builds, or when running in Node.js, do nothing. - if (process.env.NODE_ENV === 'production' || typeof window === 'undefined') { + if ( + (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') || + typeof window === 'undefined' + ) { return; }