App Finishers

Fix guide · updated 2026-11-16

Chrome "Permission was denied for this request to access the loopback address space"

Access to fetch at 'http://127.0.0.1:54321/…' has been blocked by CORS policy: Permission was denied for this request to access the `loopback` address space.

Your live app's call to http://127.0.0.1:54321 fails, and Chrome's console says "Permission was denied for this request to access the `loopback` address space". Or your live site shows a Chrome prompt asking to Access other apps and services on this device. Either way, your deployed app is calling the Supabase that runs on your own computer. We reproduced it offline in Google Chrome 157 with supabase-js 2.119. The surprise is who sees what: on your computer, clicking Allow makes the live site work, using the database on your laptop. Your visitors never see the prompt. They just get "Failed to fetch".

What the error means

Since Chrome 142, a website must ask before it talks to software on the visitor's own computer (localhost, 127.0.0.1: Chrome calls this the loopback address space) or to devices on their home or office network (192.168.x.x, 10.x.x.x: the local address space). Chrome calls this Local Network Access. It stops websites from attacking your router or the apps running on your machine. The message means the site doesn't have that permission: someone clicked Block, or the browser couldn't ask. This is the prompt, as Chrome 157 showed it for our test site:

Chrome prompt: myapp.example:8443 wants to Access other apps and services on this device, with Block and Allow buttons

For a Supabase app, http://127.0.0.1:54321 is the address where supabase start runs Supabase on your computer (http://localhost:54321 gives the same message). Your hosted project lives at https://<project-ref>.supabase.co. So the build you deployed still has your local address in it.

Your code gets TypeError: Failed to fetch from database calls and AuthRetryableFetchError: Failed to fetch (status 0) from sign-in. One read prints the console line 4 times and its error takes about 7 seconds to arrive, because supabase-js 2.119 retries a failed read 3 times, after 1, 2 and 4 seconds.

What we saw in Chrome

We served a test app over HTTPS and told Chrome to treat it as a public website, with Chrome's own testing switch --ip-address-space-overrides. A stand-in for local Supabase answered on 127.0.0.1:54321. Then we ran the same select() in each situation:

The fix: point the live app at your hosted project

1. Find where the local address comes from. Search your project for 54321 and 127.0.0.1. The usual places:

2. Put your hosted project's address and key there. In the Supabase dashboard, open the project and click Connect to copy its URL (https://<project-ref>.supabase.co) and its anon or publishable key. Keep the local values in .env.local only. If you build a Vite app on your computer, put the hosted values in .env.production: Vite gives it priority over .env.local in a production build. Values set in your host's settings beat every .env file.

3. Deploy again. Vite and Next.js copy these values into your JavaScript when the app is built, so changing a setting alone changes nothing on the live site.

4. Check the live site. Open it, press F12, open the Network tab and reload. The requests must go to https://<project-ref>.supabase.co, and the console line is gone.

5. Move what you built locally. Tables, policies and functions you made with supabase start exist only on your computer. Run supabase link --project-ref <project-ref>, then supabase db push, which applies the files in supabase/migrations. If you made tables by clicking in your local Studio, supabase db diff -f my_tables writes them into a migration first. Users and rows don't move with it. Skip this and the live app fails next with "Could not find the table in the schema cache".

Clicked Block while testing? Click the icon left of the address, then Site settings, and set Apps on device back to Ask. Once the app calls your hosted project, nobody needs this permission.

Stop it from happening again

Make a production build refuse a local address. In a Vite app, next to createClient:

const url = import.meta.env.VITE_SUPABASE_URL
if (import.meta.env.PROD && /localhost|127\.0\.0\.1/.test(url)) {
  throw new Error(`This build uses the local Supabase (${url}). Set VITE_SUPABASE_URL to https://<project-ref>.supabase.co and deploy again.`)
}

A wrong build then fails loudly, with a message that says what to fix, instead of quietly working for you alone.

If you meant to reach the visitor's computer

Some apps really do talk to software on the user's machine: a local AI model server, a printer or scale bridge, a desktop companion app. Then the prompt is expected. Chrome's guide for sites that use the local network covers it. The short version:

In automated tests

Headless Chrome can't show the prompt. In our test, a page that had never been given the permission failed with this exact message. In Playwright (1.58), grant it to the test's browser context with await context.grantPermissions(['local-network-access']); the same call then worked. If the address shouldn't need the permission at all, Chrome's switch --ip-address-space-overrides=10.0.1.108:0=public makes it treat that address as public (port 0 means every port).

If an AI tool built your app

Give your AI tool this prompt:

My deployed app calls Supabase at http://127.0.0.1:54321 (my local Supabase), and Chrome blocks it with "Permission was denied for this request to access the `loopback` address space". Find every place the Supabase URL and key come from: the code, .env files and build settings. Make the app read them only from environment variables (VITE_SUPABASE_URL and the key variable this project already uses), keep the local values in .env.local only, and make a production build throw a clear error if the URL contains localhost or 127.0.0.1. Then tell me which values to set on my host before I deploy again. Don't change anything else.

Not quite your error?

Still stuck?

Read the console line closely: the address after Access to fetch at is where your app tried to go, and the one after from origin is the page that asked. If the first one is your supabase.co address, this isn't your problem. If it's a local address and you can't find where it comes from, open DevTools, go to Sources, press Ctrl+Shift+F (Cmd+Option+F on a Mac) and search the live site's code for 54321. The file it finds is where your build put it.

Other problems with an AI-built app? See Vibe code rescue.