© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•5mo ago•
68 replies
david_eason

I got 'TypeError: fetch failed'

const supabaseAdmin = createClient(
supabaseUrl,
supabaseServiceKey,
{
auth: {
persistSession: false,
autoRefreshToken: false,
},
}
);

const { data: testConnection, error: connectionError } = await supabaseAdmin
.from('users')
.select('id')
.limit(1);

if (connectionError) {
console.error('Supabase connection error:', connectionError);
return NextResponse.json(
{ error: 'Database connection failed. Please ensure Supabase is running.' },
{ status: 503 }
);
}

This is my code.
but when I try to run this, I got the error.
message: 'TypeError: fetch failed',
message: 'TypeError: fetch failed',


How can I fix this problem?
Any help is thanks.
thanks.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

TypeError: fetch failed
SupabaseSSupabase / help-and-questions
3y ago
Getting an error: "TypeError: Failed to fetch"
SupabaseSSupabase / help-and-questions
3y ago
Fetch Failed
SupabaseSSupabase / help-and-questions
13mo ago
Failed to fetch?
SupabaseSSupabase / help-and-questions
3mo ago