Supabase "TypeError: Failed to fetch": how to fix it
Your Lovable, Bolt or Cursor app worked yesterday, and now sign-in or every query fails with TypeError: Failed to fetch, or AuthRetryableFetchError: Failed to fetch. That message means the browser never got an answer from Supabase at all. It is not a wrong password and usually not a bug in your code. Here are the causes in the order worth checking.
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Step 1: look at the failed request
Open the browser's developer tools, go to the Network tab and repeat the action. Click the red request and look at its address and status:
- The address starts with
undefined/or your own site's address: the Supabase URL isn't set in production (cause 2). - It goes to
https://yourproject.supabase.coand shows (failed) or ERR_NAME_NOT_RESOLVED: the project is paused, or the network is blocking it (causes 1 and 4). - The console also shows a CORS error: an Edge Function or custom API is answering without the right headers (cause 3).
1. The Supabase project is paused
Free Supabase projects are paused after a period of inactivity. The app's code is fine, but nothing answers. Open the Supabase dashboard. If the project says it is paused, restore it and wait a few minutes. If real users rely on the app, a paid plan stops this happening again.
2. The Supabase URL or key is missing on the live site
If it works in preview but fails once deployed, the live site probably never got the environment variables. On Vercel or Netlify, add them in the project settings under Environment Variables, using the exact names your code reads, then redeploy (the values are baked in at build time):
VITE_SUPABASE_URL=https://yourproject.supabase.co
VITE_SUPABASE_ANON_KEY=... # or your sb_publishable_ key
Vite apps only see variables that start with VITE_; Next.js needs NEXT_PUBLIC_. A quick check: console.log(import.meta.env.VITE_SUPABASE_URL) on the live site should print your project address, not undefined. More in our guide to environment variables undefined in production.
3. An Edge Function or API call is blocked by CORS
If the failing call goes to /functions/v1/... or your own API, the browser can report a blocked CORS response as "Failed to fetch". The function must answer the OPTIONS request and send CORS headers on every response, errors included. See CORS error after deploy and Edge Function returned a non-2xx status code.
4. Only some users get it: their network or browser
If it works for you but a few users report it, something between them and Supabase is blocking the request: a strict ad blocker or privacy extension, a work or school network, a VPN, or an internet provider that blocks supabase.co. Ask an affected user to try another network or a private window without extensions. If a whole country or provider is affected, the long-term fix is to put Supabase behind your own domain (Supabase offers custom domains on paid plans) or route calls through your own server.
5. The page is http but calls https (or the reverse)
Browsers block mixed content. If your site is served over plain http:// or the Supabase URL in your settings has a typo, requests can fail without a clear message. Make sure the site is on https:// and the URL exactly matches the one in Supabase under Project Settings then Data API.
Quick checklist
- Read the failed request in the Network tab before changing code
- Project is active, not paused
- Supabase URL and key set on the live site with the right prefix, then redeployed
- Edge Functions answer OPTIONS and send CORS headers
- Test on another network and without extensions if only some users see it
Stuck on this? Get it fixed for €49.
Fixed in 48 hours or you don't pay. Launch deal for the first 5 customers (normally €79). You get the tested fix as a pull request, so nothing changes until you merge it.
Get it fixed for €49Still stuck?
Mendlark fixes this kind of problem for a fixed €49 (launch price, normally €79). We agree the problem first, test the fix and send it as a pull request, so nothing changes in your app until you merge it. If we can't fix it, you don't pay. Get the €49 fix, or start with a free scan.
Not sure what else is wrong? Paste your app link into the free instant check and get a plain-English list of problems in seconds.