From cf1264f614e22dd74f4e2b7e8a93f32812c38f9c Mon Sep 17 00:00:00 2001 From: Jordi Enric <37541088+jordienr@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:52:57 +0100 Subject: [PATCH] fix window undefined error when ssr some pages (#21295) fix --- apps/studio/lib/helpers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/studio/lib/helpers.ts b/apps/studio/lib/helpers.ts index a82ced07660..b09b1829750 100644 --- a/apps/studio/lib/helpers.ts +++ b/apps/studio/lib/helpers.ts @@ -219,6 +219,7 @@ export const detectBrowser = () => { } export const detectOS = () => { + if (typeof window === 'undefined' || !window) return undefined if (typeof navigator === 'undefined' || !navigator) return undefined const userAgent = window.navigator.userAgent.toLowerCase()