Skip to content

Commit 1b160a5

Browse files
author
Deepak Pandey
committed
Fix app/verify/[memberId]/page.tsx - module-level Supabase client initialization
- Fixed app/verify/[memberId]/page.tsx: Converted module-level Supabase client to lazy getSupabaseClient() function - Updated supabase reference in getMemberData function to use lazy initialization - This resolves the final 'Missing Supabase environment variables' build error - Build now passes successfully with 142/142 pages generated - ALL module-level Supabase client initialization issues now completely resolved
1 parent 369e918 commit 1b160a5

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

app/verify/[memberId]/page.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import { CheckCircle2, AlertCircle, User, Mail, MapPin, Calendar } from 'lucide-
77
import Link from 'next/link';
88
import { createClient } from '@supabase/supabase-js';
99

10-
// Supabase Init
11-
const supabase = createClient(
12-
process.env.NEXT_PUBLIC_SUPABASE_URL || '',
13-
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || ''
14-
);
10+
// Create Supabase client function to avoid build-time initialization
11+
function getSupabaseClient() {
12+
return createClient(
13+
process.env.NEXT_PUBLIC_SUPABASE_URL || '',
14+
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY || ''
15+
);
16+
}
1517

1618
// MemberData interface
1719
interface MemberData {
@@ -29,6 +31,7 @@ interface MemberData {
2931
async function getMemberData(memberId: string): Promise<MemberData | null> {
3032
const suffix = memberId.replace(/^CU-/, '').toLowerCase();
3133

34+
const supabase = getSupabaseClient();
3235
// Fetch all (or paginated) and find match by ID suffix
3336
const { data: profiles, error } = await supabase
3437
.from('profiles')

0 commit comments

Comments
 (0)