Fix guide · updated 2026-11-07
Supabase "requested path is invalid": what it means and the fix
{"error":"requested path is invalid"}
A user clicks Confirm your email, or signs in with Google, Apple or X, and lands on a page that only says {"error":"requested path is invalid"}. Or an upload or a database call in your app fails with the same words. It looks cryptic, but it always means the same thing: something sent the browser, or your code, to an address on your Supabase project that doesn't exist. Find what sent it there, and the fix takes a few minutes.
What the error means
Your Supabase project lives at an address like https://abcdefghijklmnopqrst.supabase.co. That's your backend, not a website: it only answers specific paths such as /auth/v1/…, /rest/v1/… and /storage/v1/…. Open the bare address, or a path that doesn't exist, and Supabase answers with this error. So look at the address bar when it happens:
- It starts with
https://…supabase.coright after an email link or a login: see section 1. - It only happens with X (Twitter), Apple or Google login: see section 2.
- Your code gets it back from an upload, a query or an
rpc()call: see section 3.
1. Logins and email links land on your Supabase address
Supabase has two addresses that are easy to mix up:
- The Project URL (click Connect at the top of the Supabase dashboard), like
https://abcdefghijklmnopqrst.supabase.co. Your app's code talks to it. - The Site URL (Authentication → URL Configuration). That's where Supabase sends people after a login or an email link. It must be your app, like
https://yourapp.com.
If the Site URL holds the Project URL, every confirmation link and every login ends on this error. Fix it in three steps:
- Site URL: put your app's live address. Save.
- Redirect URLs, on the same page: add every address users should come back to, ending with
/**, for examplehttps://yourapp.com/**. - Your code: tell Supabase to send people back to your app, never to Supabase.
// Email sign-up: where the confirmation link sends people
await supabase.auth.signUp({
email,
password,
options: { emailRedirectTo: `${window.location.origin}/` },
});
// Google, Apple, X…
await supabase.auth.signInWithOAuth({
provider: "google",
options: { redirectTo: `${window.location.origin}/` },
});
A common trap: putting https://…supabase.co/auth/v1/callback in redirectTo. That callback address belongs in Google's, Apple's or X's developer console. In your code, redirectTo must point back to your app.
Then send yourself a new confirmation email to test. Links in emails sent before the fix keep the old address.
2. Only X (Twitter), Apple or Google login fails
When the step at the provider fails, Supabase sends the user back to your app's address with the reason attached. If that address is wrong, you get this message instead of the real error. Look at the address bar anyway: the real reason is often written there, after error_description=. Fix section 1 first, then check two things:
- The callback in the provider's console is exactly
https://<your-project-ref>.supabase.co/auth/v1/callback. Supabase shows it under Authentication → Providers, on that provider's page. - The keys you pasted into Supabase are the ones for the login type you turned on. With X, it's easy to copy the wrong pair from its developer portal.
3. Your code gets the error from an upload or a query
Check the Supabase address your app uses. It must be exactly the Project URL, with nothing after .supabase.co: the Supabase library adds /rest/v1, /storage/v1 and the rest by itself, so anything extra ends up in front of every request. One case gives a different message: with /rest/v1 at the end of the address (the API URL shown on Project Settings → Data API), requests reach the database API and fail with "Invalid path specified in request URL" instead, sign-up and login included. See that guide.
- Lovable apps: the address is in
src/integrations/supabase/client.tsor inVITE_SUPABASE_URL. Bolt and other Vite apps:VITE_SUPABASE_URL. Next.js:NEXT_PUBLIC_SUPABASE_URL. - Hosting on Vercel or Netlify? Check the environment variables there too, then redeploy: the build bakes the value into your app.
- Using an S3 tool with Supabase Storage? Its endpoint must end with
/storage/v1/s3.
If your project runs on Lovable Cloud rather than your own Supabase project, the same settings exist there: look in its authentication settings for the site and redirect addresses.
Still stuck?
Supabase → Authentication → Logs shows each login attempt and where Supabase tried to send the user. If users now land on localhost instead, see our guide on Supabase login redirecting to localhost.
Other Supabase problems? See Supabase fixes.