App Finishers

Fix guide · updated 2026-11-11

Supabase auth "Failed to fetch": why login fails and how to fix it

AuthRetryableFetchError: Failed to fetch · TypeError: Failed to fetch · Load failed

A user taps Sign in or Sign up and gets Failed to fetch. In Safari it says Load failed, in Firefox NetworkError when attempting to fetch resource. This isn't a wrong password. It means the browser never got a usable answer from your Supabase project. There are only a few usual causes, and one line in your browser's Network tab tells you which one in about two minutes.

What the error means

Supabase's JavaScript client sends every login request with the browser's fetch. If that request fails before any answer comes back, the client turns the browser's message into an AuthRetryableFetchError with status 0. Supabase's own code lists the reasons: a network failure, a CORS block, or an aborted request. The same error with a status like 503 is different: Supabase did answer, with a server error. "Retryable" means the connection failed, not the login itself, so trying again later can work.

1. Read the failing request (2 minutes)

Open your live site, press F12 (Mac: Cmd+Option+I), open the Network tab and try to sign in again. Find the request to your Supabase address: token?grant_type=password for a password login, signup for a sign-up, otp for a magic link. Look at its status, then at the red line in the Console tab:

2. Check the project address your live app uses

The failing request must go to https://<your-project-ref>.supabase.co/auth/v1/…, and that must be the URL of the project you're actually using: open the project in the Supabase dashboard and click Connect at the top to see it. A project address that doesn't exist (a typo, a deleted project) doesn't resolve at all, which is exactly ERR_NAME_NOT_RESOLVED. Usual mismatches:

Where the address lives: in a Lovable project, in src/integrations/supabase/client.ts, either written out or read from the .env file (VITE_SUPABASE_URL). On Vercel or Netlify it's in the site's environment variables. A Vite app copies these into the build, so redeploy after changing one. Editing the setting alone changes nothing on the live site.

3. Make sure the project isn't paused

Supabase pauses Free plan projects that show low activity over a 7-day period. They email the owner a warning about a week before, then a confirmation. A paused project can't process requests: Supabase answers with its own status code 540, project paused, and your login breaks for everyone.

Fix: open the Supabase dashboard, select the organization, then the paused project, click Resume project and confirm. You can restore it for up to 1 year after the pause, with its data and settings. To stop it from happening again, either move to a paid plan (paid projects are never paused for inactivity) or make sure the app gets real use: Supabase says a few user requests to the database each day over the week is typically enough.

4. Rule out the network and the browser

Try the same login on a phone using mobile data (Wi-Fi off), then in a private window with extensions turned off. If it works there, your app is fine and something on the first browser or network is blocking Supabase:

5. "Blocked by CORS policy"

The browser received an answer but refused to hand it to your app, because the answer didn't say your site was allowed to read it. With Supabase login, this mostly comes from something between your app and Supabase: an extension that rewrites CORS headers (the private-window test in step 4 settles that), or a proxy you put in front of Supabase that doesn't pass those headers on. Check the address too (step 2): the request should go straight to your project's supabase.co address or your own custom domain. If you call your own Edge Function from the browser instead, that function has to send its own CORS headers.

6. The page reloads and cancels the request

If the request shows (canceled) and the page flashes or reloads when you press the button, your form is doing an old-style browser submit. The address bar may end with ?, or even show the email and password. The reload kills Supabase's request halfway, and that comes back as Failed to fetch. Handle the submit on the form and stop the reload first:

<form onSubmit={async (event) => {
  event.preventDefault(); // stops the page reload
  const { error } = await supabase.auth.signInWithPassword({ email, password });
  // show error or go to the app
}}>

Ask your AI builder for exactly that: "handle the login on the form's onSubmit and call event.preventDefault() first".

7. When the problem is on Supabase's side

Show your users a clear message

Whatever the cause, nobody should see a bare Failed to fetch. Supabase exports a check for this exact error:

import { isAuthRetryableFetchError } from "@supabase/supabase-js";

const { error } = await supabase.auth.signInWithPassword({ email, password });
if (error) {
  setMessage(
    isAuthRetryableFetchError(error)
      ? "We can't reach the server right now. Check your connection and try again."
      : error.message
  );
}

If it says "fetch failed" instead

A lowercase fetch failed (without "to") comes from server code running on Node.js, such as a Next.js route or a server action, not from the browser. It means the same thing: that server couldn't reach Supabase. Check the address in the server's environment variables (step 2) and whether the project is paused (step 3).

Still stuck after all this? Send us the project and we'll find it.

Sources: Supabase JavaScript client, auth fetch code and error types; Supabase docs, HTTP status codes, Project pausing, Auth error 503 AuthRetryableFetchError, Failed to fetch and browser extensions, Custom domains, API keys; TechCrunch, February 27, 2026; Analytics India Magazine, March 4, 2026.

Other Supabase problems? See Supabase fixes.