From 553bfed070e3a5a9c3a570cfc9141d43cb17a4f5 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 5 Jun 2026 15:24:17 +0000 Subject: [PATCH] fix(supabase): don't force mock mode for non-supabase.co URLs (PostgREST compat) --- src/lib/supabase.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/supabase.ts b/src/lib/supabase.ts index fdf5add..dc3eb90 100644 --- a/src/lib/supabase.ts +++ b/src/lib/supabase.ts @@ -4,8 +4,10 @@ import { getMockTableData } from "./mock-data"; const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL; const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY; -// Auto-enable mock mode when no Supabase URL is configured (demo/deployment without backend) -const useMockData = process.env.NEXT_PUBLIC_USE_MOCK_DATA === "true" || !supabaseUrl || !supabaseUrl.includes("supabase.co"); +// Auto-enable mock mode when no Supabase URL is configured (demo/deployment without backend). +// Note: do NOT trigger on non-supabase.co URLs — local PostgREST (e.g. http://localhost:3001) +// uses the same supabase-js client. Mock mode is for deployments without any database. +const useMockData = process.env.NEXT_PUBLIC_USE_MOCK_DATA === "true" || !supabaseUrl; // Mock query builder that supports all common Supabase methods class MockQueryBuilder {