"TypeError: Failed to fetch" in a Lovable or Bolt app with Supabase: fixes (2026)
Prices and facts checked on each tool's official site. Plans change often, so confirm before you pay.
Your Lovable or Bolt app shows TypeError: Failed to fetch when it loads data, signs someone in, or calls a function. Sometimes it's AuthRetryableFetchError with status 0. Nothing saves, nothing loads, and the message doesn't say why. Here's how to find the real cause in a few minutes.
What the error means
Your app talks to Supabase with the browser's fetch(). MDN explains that fetch() only fails like this when the request itself fails, for example because the URL is bad, the request is blocked, or there's a network error. If Supabase had answered with an error such as 400 or 500, you'd see that error instead. So Failed to fetch means the request never got a normal answer back. Supabase's sign-in library reports the same thing as AuthRetryableFetchError with status 0.
Match the situation to the cause
| What you see | Most likely cause |
|---|---|
| Everything fails, and nobody used the app for a while | Your Free plan Supabase project was paused |
| Works in preview, fails on the published site | The live build is missing the Supabase URL or key, so it calls the wrong address |
| Only when calling an Edge Function, console mentions CORS | The function doesn't send CORS headers or doesn't answer the OPTIONS preflight |
| Console says Mixed Content | An http:// address is being called from your https:// site |
| Fails only for some people or on one device | An ad blocker, privacy extension, VPN, office firewall or a bad connection |
| Only when calling another company's API from the browser | That API doesn't allow calls from browsers (CORS); call it from an Edge Function instead |
Step 1: look at the failed request
Open the published app, press F12 (or right-click, Inspect), and open the Console and Network tabs. Make the error happen again. Click the red request and read its URL. MDN notes that for security reasons JavaScript isn't told why a CORS request failed; only the console shows the details, so the console text is your best clue.
- URL contains
undefinedor isn't yourhttps://…supabase.coproject: go to step 3. - Console says CORS: go to step 4.
- Console says Mixed Content: go to step 5.
- URL looks right and there's no CORS message: check steps 2 and 6.
2. Your Supabase project is paused
Supabase pauses Free plan projects with low activity over a 7-day period. The project owner gets a warning email about a week before and another email once it's paused. While it's paused, every request from your app fails. To fix it, open the Supabase Dashboard, select the organization and the paused project, and click Resume project. Your data and settings come back. You can restore a paused project for up to 1 year. Paid projects aren't paused, so if the app is live for real users, the Pro plan avoids this.
3. Missing Supabase URL or key after publishing
Lovable and Bolt apps read the Supabase URL and anon (publishable) key from settings, often environment variables like VITE_SUPABASE_URL. If the published build doesn't have them, the app calls an empty or wrong address and fails. Add the same values on your host (for example Netlify or Vercel environment variables), then redeploy so they're baked into the build. Never put the service role or secret key in browser code. Our works in preview but broken after publishing guide covers this step by step.
4. CORS errors from Edge Functions or other APIs
When the console says a request was blocked by CORS, the server didn't give the browser permission to read the answer. For your own Supabase Edge Function, the function needs to answer the OPTIONS preflight and add CORS headers to every response, including error responses. See the CORS part of our Edge Function error guide. For another company's API that doesn't allow browser calls, you usually can't fix it from your page: move the call into an Edge Function and call that from the app.
5. Mixed content: http on an https site
A page loaded over https:// can't call an http:// address with fetch(); browsers block it as mixed content. Make sure every address in the code starts with https://, including the Supabase URL and any API you call.
6. Blockers, VPNs and bad connections
If only some people see it, test in a private window with extensions off, on another network, and on your phone's data. Ad blockers and privacy extensions sometimes block requests, and some office networks block unfamiliar domains. If it only fails there, the code is fine; tell those users or add a friendly "check your connection and try again" message instead of a raw error.
What to paste into Lovable or Bolt
My app shows "TypeError: Failed to fetch" when [action] on [preview / the published site]. Don't change any code yet. First tell me: which URL that request goes to, where the Supabase URL and anon key come from and whether they are set for the published build, whether the request is to an Edge Function or another API and whether it sends CORS headers (including for OPTIONS), and whether any address uses http instead of https. Then list the fixes in order. Don't put the service role key in browser code and don't turn off Row Level Security.
When it's time to get help
Often it's a paused project or a missing setting on your host. Get a second pair of eyes when:
- Real users can't sign in or load anything and you're losing them.
- It only fails on the live site and you can't see why.
- The AI keeps rewriting your Supabase setup without fixing it.
- You're about to launch and want the whole app checked.
| Option | Price | What you get |
|---|---|---|
| App Audit | $49 one-time | A plain-English written fix list for this error and anything else that breaks, within 3 business days |
| Payments Live | $199 one-time | Stripe payments wired into your app and tested with test cards before going live |
| Launch Pack | $499 one-time | Agreed bug fixes, Stripe payments, and your app published on your own domain with HTTPS |
We confirm the scope by email before any work starts, and you can ask questions first without paying. Never send anyone your password or your Supabase secret key.
Related guides
- Supabase answered with an error instead? See row-level security policy errors, permission denied for table and Edge Function non-2xx errors.
- Sign-up emails not arriving? See Supabase auth emails not sending.
- Not sure what your error means? Paste it into the free error decoder, or take the 2-minute launch self-check.
Sources
- MDN: fetch() (when fetch rejects with TypeError)
- MDN: CORS errors (details only in the console)
- MDN: mixed content (fetch to http blocked on https pages)
- Supabase: project pausing (7-day low activity, emails, Resume project, 1-year restore, paid plans not paused)
- supabase-js source (AuthRetryableFetchError with status 0)
- Supabase: CORS for Edge Functions
FAQ
What does TypeError: Failed to fetch mean?
The browser couldn't finish the request at all, so there's no answer from the server for your app to read. The usual reasons are a wrong or missing Supabase URL, a paused Supabase project, a request blocked by CORS or mixed content, or a network problem such as an ad blocker, VPN or no connection. It's different from a 400 or 500 error, which means the server did answer.
Why does my Supabase app suddenly say Failed to fetch for everything?
If you're on Supabase's Free plan and nobody used the app for about a week, Supabase may have paused the project. Open the Supabase Dashboard, select the project and click Resume project. Paid projects aren't paused.
Why does it work in preview but say Failed to fetch after publishing?
Often the published build doesn't have your Supabase URL and key, so the app calls an empty or wrong address. Check the request URL in the browser's Network tab and set the environment variables on your host, then republish.
What is AuthRetryableFetchError?
It's how Supabase's sign-in library reports a request that never got a normal answer, often with status 0 and the message Failed to fetch. Treat it like any Failed to fetch: check the URL, the project status and the console for CORS or blocked requests.
Some links are referral links; we may earn a commission at no extra cost to you. It never changes our recommendations.