diff --git a/packages/utils/src/isBrowser.ts b/packages/utils/src/isBrowser.ts index aa0a4bfa11db..1670d347f4bb 100644 --- a/packages/utils/src/isBrowser.ts +++ b/packages/utils/src/isBrowser.ts @@ -1,4 +1,5 @@ import { isNodeEnv } from './node'; +import { GLOBAL_OBJ } from './worldwide'; /** * Returns true if we are in the browser. @@ -12,5 +13,8 @@ type ElectronProcess = { type?: string }; // Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them function isElectronNodeRenderer(): boolean { - return typeof process !== 'undefined' && (process as ElectronProcess).type === 'renderer'; + return ( + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any + (GLOBAL_OBJ as any).process !== undefined && ((GLOBAL_OBJ as any).process as ElectronProcess).type === 'renderer' + ); }