From ab4e9f846eca63530a95e6a9d4e9a0f978360d26 Mon Sep 17 00:00:00 2001 From: pascalyazid Date: Mon, 28 Sep 2026 18:32:47 +0200 Subject: [PATCH] updated next.config for deployment --- next.config.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/next.config.ts b/next.config.ts index 35468d7..b7448f8 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,16 +1,23 @@ -import type { NextConfig } from "next"; +import type { NextConfig } from 'next'; -const { hostname: supabaseHostname } = new URL( - process.env.NEXT_PUBLIC_SUPABASE_URL!, -) +const getHostname = (urlStr: string | undefined): string | null => { + if (!urlStr || urlStr.trim() === '') return null; + try { + return new URL(urlStr).hostname; + } catch { + return null; + } +}; + +const supabaseHostname = getHostname(process.env.NEXT_PUBLIC_SUPABASE_URL); const nextConfig: NextConfig = { - output: "standalone", - basePath: process.env.BASE_PATH, + output: 'standalone', images: { remotePatterns: [ { - hostname: supabaseHostname, + protocol: 'https', + hostname: supabaseHostname ?? '**.supabase.co', pathname: '/storage/v1/object/**', }, ],