© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3mo ago•
1 reply
Zhorky

"Failed to send a request to the Edge Function" - but function got invoked

I just started learning supabase. Following edge function got created without jwt verification.
Deno.serve(async () => {
    const name  = "World"
    const data = {
        text: `Hello ${name} -|- Welcome to Supabase Functions!`
    }
    console.log("hello-world function invoked:", data)

    return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })
})
Deno.serve(async () => {
    const name  = "World"
    const data = {
        text: `Hello ${name} -|- Welcome to Supabase Functions!`
    }
    console.log("hello-world function invoked:", data)

    return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })
})


When i call it from my nextjs frontend like this:
 const { data, error: fnError } = await supabaseClient.functions.invoke("hello-world", {});
 const { data, error: fnError } = await supabaseClient.functions.invoke("hello-world", {});

The function runs in supabase successfully (2xx statuscode), but the FE tells me "Failed to send a request to the Edge Function"

Any ideas why this happens?

EDIT:
Maybe useful: the OPTIONS call in preflight works, only the actual call to the function breaks
When i call the URL manuall i get the expected response
image.png
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

Similar Threads

Failed to deploy edge function
SupabaseSSupabase / help-and-questions
7mo ago
Edge Functions: Failed to load function codeFailed to retrieve function bundle
SupabaseSSupabase / help-and-questions
4mo ago
[Local Edge function] OpenAI package: failed to bootstrap runtime: failed to create the graph
SupabaseSSupabase / help-and-questions
3mo ago
CORS enabled Edge function example in the Supabase docs throwing error when invoked
SupabaseSSupabase / help-and-questions
3y ago