← 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

How to fix it

  1. Open Supabase Dashboard → Edge Functions → your function → Logs to see the actual exception.

  2. 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());
    }
  3. Set missing secrets:

    supabase secrets set OPENAI_API_KEY=...

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy