Skip to content

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

fix: Handle a case where API_URL is not defined while building `studio` (#21016)

Ivan Vasilovb145c8613f2d
diff --git a/apps/studio/next.config.js b/apps/studio/next.config.js
index 88642633e32..5a4071a57b9 100644
--- a/apps/studio/next.config.js
+++ b/apps/studio/next.config.js
@@ -6,7 +6,9 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
// Required for nextjs standalone build
const path = require('path')
-const API_URL = new URL(process.env.NEXT_PUBLIC_API_URL).origin
+const API_URL = process.env.NEXT_PUBLIC_API_URL
+ ? new URL(process.env.NEXT_PUBLIC_API_URL).origin
+ : ''
const SUPABASE_URL = new URL(process.env.SUPABASE_URL).origin
const GOTRUE_URL = new URL(process.env.NEXT_PUBLIC_GOTRUE_URL).origin
const SUPABASE_PROJECTS_URL = 'https://*.supabase.co'