Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix window undefined error when ssr some pages (#21295)

Jordi Enriccf1264f614e2
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()