diff --git a/src/lib/is-browser.ts b/src/lib/is-browser.ts index 7961aa20d..cdf926a3e 100644 --- a/src/lib/is-browser.ts +++ b/src/lib/is-browser.ts @@ -4,7 +4,8 @@ const isStandardBrowserEnv = () => { // Is the process an electron application // check if we are in electron `renderer` const electronRenderCheck = - navigator?.userAgent?.toLowerCase().indexOf(' electron/') > -1 + typeof navigator !== 'undefined' && + navigator.userAgent?.toLowerCase().indexOf(' electron/') > -1 if (electronRenderCheck && process?.versions) { const electronMainCheck = Object.prototype.hasOwnProperty.call( process.versions,