DIAGNOSIS

"Failed to send a request to the Edge Function" — what actually broke

The message isn't from your code, and the fix depends on which of four very different things went wrong.

8 min read
ON THIS PAGE
SHORT ANSWER

What does "Failed to send a request to the Edge Function" mean?

It means the browser sent your request to a small piece of code running on Supabase's servers and never got back an answer it would accept. Supabase's library can't tell why, so it shows the same wording every time. The real cause is usually a blocked permission check, a function that was never deployed, or a missing login token.

You clicked the button. Nothing happened, or a red box appeared with those words in it. Your app was fine yesterday. Now payments won't go through, or the signup email never sends, or the AI feature just spins.

Here's the thing that changes where you look: that sentence is not an error from your code. The request went out. Something happened — or didn't — and the answer never arrived in a form the browser would accept. Supabase says as much in its own troubleshooting notes: when a function can't be found at the address being called, the client shows only a generic message4. One message, many causes. That's why every forum answer you've read contradicts the last one.

The thing being called here is a small piece of code that runs on Supabase's servers instead of in your users' browsers — what your AI builder reaches for whenever something has to stay secret, like a payment key or an email password.

What causes it, and in what order should I check?

Four things cause nearly all of these, and they fail in completely different places. Work through them in this order, because the first one is both the most common and the one that makes your logs look flawless.

  1. The code ran fine and the browser threw the answer away
    Before your app is allowed to call the function, the browser quietly asks permission first and waits. If the function doesn't answer that question, or answers without the right permission note attached, the browser refuses to hand the real result back. One report on Supabase's GitHub describes exactly this: the function runs and logs appear both locally and in the cloud, but the front end never gets a response1. Supabase lists this first in its own checklist — review the cross-origin settings and make sure the function handles the browser's advance permission request5.
  2. The function isn't where the app thinks it is
    Supabase's advice here is short: check the name for typos, run a test call from the Function Dashboard, and redeploy from the dashboard's code tab4. The two blunt causes in their docs are the ones that catch everyone — not deployed, or wrong address6. If you build with Lovable, Bolt or Base44, suspect this more than you think. The chat says it created the function; pushing it live is a separate step that can quietly fail or be skipped on a rollback.
  3. The function is locked and your app didn't bring a key
    Functions can demand proof of a signed-in user before they'll run at all. Supabase describes it as the function requiring that check while the request arrives without the credentials attached6. The request gets turned away before your code runs, so the logs show nothing useful. The setting sits under Edge Functions → your function → Settings. Only turn it off if the function genuinely doesn't need to know who's calling. If it charges a card or returns private data, leave it on and fix the call instead.
  4. It isn't you
    Sometimes this is intermittent and unrelated to anything you did. A team filed exactly that on the Supabase edge runtime repo in 2024, reporting errors they could never reproduce locally2. An earlier 2023 report described a far worse rate, with more than half of calls failing3. If a function worked ten minutes ago, has the same code, and fails for some users but not others — stop editing. You are probably editing a working function.
~98.5%2
of calls getting through fine in a 2024 report of intermittent failures
More than half3
of calls returning the error in an earlier 2023 report

If you're on a recent Supabase library, part of this got easier. From version 2.95.0 of the JavaScript client you can import the permission headers directly from the library so they stay in sync; before that version you hardcode them in a shared file7.

How do I tell these apart in five minutes?

Open your Supabase dashboard, go to Edge Functions, pick the function, and open Logs. Then make the thing happen in your app again and watch what appears.

What the logs showWhat it means
Nothing at allThe request never reached your code — not deployed, wrong name, or turned away for not being signed in.
The call runs and finishes cleanlyThe answer came back and the browser binned it over permissions. Fix the cross-origin settings.
Your code starts, then failsA normal bug, and now you have a real message to read.
Works for most people, fails for some, no patternIntermittent. Watch it. Don't edit.
Reading the logs

One more thing worth ruling out. There's an open report on the Supabase JavaScript library where the invoke call didn't send the body of the request at all — content length showing as zero — and a raw fetch worked instead8. If your function insists it received nothing when you're certain you sent something, that's a known rough edge, not your imagination.

This error travels well outside Lovable, which tells you how generic it is. In the WeWeb community, a builder trying to create users and send password emails hit it on every function they wrote, including a direct copy of the example from WeWeb's own documentation — and eventually got it working by calling it over the REST API instead9.

PASTE THIS INTO YOUR AI TOOL
My Supabase function call fails with "Failed to send a request to the Edge Function". Check three things and report back before changing anything: (1) is this function actually deployed, and does the name in my front-end code match the deployed name exactly? (2) does the function answer the browser's advance permission request, and do its error responses carry the same permission headers as its successful ones? (3) does the function require a signed-in user, and is my call sending the credentials? Then fix only the one that's wrong.

Why did I find out from a user instead of from my app?

Most of the pain in this error isn't the fixing — it's the twelve hours between the break and you noticing. A deploy half-lands at 11pm, checkout fails silently, and you hear about it on Tuesday from someone who signed up on Sunday.

Something should be watching your live app and telling you. The options are genuinely different from each other, so pick on how much setup you want to do.

ToolWho it's built forWhat you get when something breaks
UptimeRobotAnyone who knows which address to watch and what a healthy answer looks likeAn email or text saying the address stopped answering
Better StackEngineering teams — richer alert rules, more checking locations, deeper historyDetailed technical alerts, and setup screens that assume knowledge
FomioPeople who built an app with an AI tool and don't want to configure anythingWorking, Having trouble or Down, plus plain-English notes on what likely went wrong — and on paid plans, a prompt to paste into the tool you built with
Three ways to find out before your users do

Be clear on the trade. UptimeRobot and Better Stack check from more places around the world and keep longer records than Fomio does. Fomio's free plan watches one app from outside, checks every five minutes, emails you when it breaks, keeps seven days of history, and needs no card. Builder watches three apps, checks every minute, keeps thirty days, and includes the fix prompts. Pro watches fifteen, keeps a year, and gives your users a public status page. Alerts arrive by email only — no SMS, WhatsApp or Discord. Current prices are on fomio.ai/pricing.

What should I do right now?

Open the function's logs and make the error happen again. If nothing shows up, redeploy and check the name. If it shows the function running happily, your problem is the browser's permission check. If it fails partway, you finally have a real error to read.

Then put something in front of it so the next break doesn't reach your users first. If you want that to be simple and in plain English, Fomio does that job.

Questions people also ask

WHERE THIS COMES FROM

  1. Failed to send a request to the Edge Function — Issue #29413 — supabase/supabase, GitHub, 1 September 2024
  2. FunctionsFetchError: Failed to send a request to the Edge Function – affecting 1% of invocations — Issue #263 — supabase/edge-runtime, GitHub, 1 February 2024
  3. Failed to send a request to the Edge Function — Issue #12293 — supabase/supabase, GitHub, 1 February 2023
  4. Edge Function 404 error response — Supabase Docs
  5. Unable to call Edge Function — Supabase Docs
  6. Error codes (Edge Functions) — Supabase Docs
  7. Persistent CORS Preflight Error on Edge Functions (OPTIONS request fails) — Discussion #38832 — Supabase, GitHub, 1 September 2025
  8. FunctionsClient.invoke not carrying body content — Issue #1587 — supabase/supabase-js, GitHub
  9. Supabase Edge Function Fails — WeWeb Community, 1 January 2026
  10. Supabase Edge Function blocked by CORS policy? Here's the fix — DEV Community, 1 October 2026
KEEP READING
Read this as markdown