← All errors · LovableServerless & Edge Function errors

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=...

Still stuck after trying this? Get it fixed for $49, or you don't pay.

Prevent this next time

Guide: catch outages before your users do.

Tools that help:

Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.

FAQ

What does "Edge Function returned a non-2xx status code" mean?

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.

What usually causes it?

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 do I fix it?

1. Open Supabase Dashboard → Edge Functions → your function → Logs to see the actual exception. 2. Read the response body on the client: 3. Set missing secrets:

Related errors

More Lovable errors and fixes →

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy