← All errors · Lovable
Edge Function returned a non-2xx status code
Exact error
FunctionsHttpError: Edge Function returned a non-2xx status code
What it means
supabase.functions.invoke() reached your Supabase Edge Function, but the function responded with an error status. The real error is in the function's logs or response body.
Likely causes
- An exception inside the function (often a missing secret such as an API key).
- Function returns 4xx/5xx for invalid input.
- Missing Authorization header when JWT verification is on.
How to fix it
Open Supabase Dashboard → Edge Functions → your function → Logs to see the actual exception.
Read the response body on the client:
const { data, error } = await supabase.functions.invoke('my-fn', { body: { x: 1 } }); if (error && error.context) { console.error(await error.context.text()); }Set missing secrets:
supabase secrets set OPENAI_API_KEY=...
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy