Open
Description
Bug report
Describe the bug
When calling supabase.functions.invoke
to a function that responds with non-2xx status code following error is returned with null data:
FunctionsHttpError: Edge Function returned a non-2xx status code
Supabase gives full freedom on how Edge Functions are implemented without enforcing any schema. However, supabase-js
is enforcing some response schema because it discards response body when status is non-2xx.
To Reproduce
- Deploy Edge functions that returns
return new Response("Malformed request", { headers: { status: Status.BadRequest } })
- Call supabase.functions.invoke to it and see that
data
is null.
Expected behavior
data
is available when Edge Functions responds with non-2xx response.