Platform

v0 fixes

Fixes that come up in v0 apps, mostly after they are hosted.

17 fixes, most common first.

  1. Rank 1. Supabase login redirects to localhost:3000 after deploy

    Login or email confirm sends users to localhost:3000 on your live site? Change Supabase's Site URL and add your domain to Redirect URLs.

  2. Rank 2. Invalid API key (Supabase)

    Supabase says "Invalid API key" on your live site? Usually the key or project URL env var is missing, mistyped, or from another project.

  3. Rank 3. Environment variables are undefined in production

    Works locally but env vars are undefined once deployed? Add them to your host, use the VITE_ or NEXT_PUBLIC_ prefix for browser code, then redeploy.

  4. Rank 4. Supabase returns an empty array [] but the table has data

    Your Supabase query returns [] with no error even though rows exist? Row Level Security is on with no policy allowing the read.

  5. Rank 5. new row violates row-level security policy for table

    Saving data fails with "new row violates row-level security policy"? Add an INSERT policy with a WITH CHECK rule and send the right user_id.

  6. Rank 8. Blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present

    "Blocked by CORS policy" on your live site? The server you call must allow your domain. How to fix it for APIs you own and ones you don't.

  7. Rank 12. Module not found: Can't resolve (build works locally, fails on Vercel)

    Vercel build fails with "Module not found: Can't resolve" but works on your Mac/PC? Usually filename casing. How to find and fix it.

  8. Rank 13. Changed an environment variable on Vercel but the live site still uses the old value

    Updated a key in Vercel env vars but nothing changed? Env var changes only apply to new deployments. Redeploy and check the right environment.

  9. Rank 14. Error 400: redirect_uri_mismatch (Sign in with Google)

    Google sign-in shows "Error 400: redirect_uri_mismatch"? The callback URL in Google Cloud must exactly match the one your app or Supabase uses.

  10. Rank 15. email rate limit exceeded (Supabase Auth)

    Supabase says "email rate limit exceeded" or sign-up emails stop? The built-in mailer allows only 2 emails an hour. Set up custom SMTP.

  11. Rank 17. Supabase service_role or secret key exposed in front-end code

    Is your Supabase service_role or sb_secret key in your browser code? Anyone can read it and bypass all security. How to rotate and fix it.

  12. Rank 21. Vercel FUNCTION_INVOCATION_TIMEOUT (504) on API routes or AI calls

    Vercel API route times out with 504 FUNCTION_INVOCATION_TIMEOUT? Common with slow AI calls. Raise maxDuration, stream, or move work to background.

  13. Rank 22. 500: INTERNAL_SERVER_ERROR / FUNCTION_INVOCATION_FAILED on Vercel

    Live site shows 500 FUNCTION_INVOCATION_FAILED but works locally? Your server code crashed. Read the runtime logs, then check env vars.

  14. Rank 24. Hydration failed because the server rendered HTML didn't match the client

    Next.js "Hydration failed" error? The server and browser drew different HTML. Fix nesting, window/localStorage use and dates.

  15. Rank 26. Vercel custom domain shows "Invalid Configuration"

    Added your domain to Vercel and it says Invalid Configuration? Set the DNS records Vercel shows at your registrar and wait for DNS.

  16. Rank 29. Stripe error: No such price / No such customer (resource_missing)

    Stripe says "No such price" or "No such customer" in production? You're mixing test and live keys or IDs. Match them.

  17. Rank 33. ReferenceError: window is not defined

    Next.js crashes with window is not defined? The page is rendered on the server, where window does not exist. Read it after the component mounts.

All platforms

Can't fix it? Get help.

If the steps didn't clear the error, send what the screen says. A person can take a look. This is a request for a paid fix, not an instant chat.

Request a fix