"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.
When i call it from my nextjs frontend like this:
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

1 Reply
SOLVED: found this page: https://supabase.com/docs/guides/functions/cors
1. missing the cors
2. missing cors and status in response
CORS (Cross-Origin Resource Sharing) support for Invoking from the ...
Add CORS headers to invoke Edge Functions from the browser.