Fix guides for AI-built apps that break after deploy
Your app works in preview, then breaks the moment real people use it. These guides cover the problems we see most often, with the exact settings to check. Each one is free and needs no signup.
Supabase "email rate limit exceeded": how to fix it
429 over_email_send_rate_limit on sign-up or reset? Move off the built-in sender, raise the limit after custom SMTP and handle the 60-second cooldown.
Vite "Failed to load module script" (MIME type text/html): how to fix it
Blank page after a redeploy? Fix stale cached pages, the wrong base path, serving source instead of the build, and catch-all routes.
"Unexpected token '<', "<!doctype "... is not valid JSON": how to fix it
Your fetch got a web page instead of JSON. Fix wrong API URLs, missing env vars, rewrites that swallow /api, and 404 or login pages.
Supabase "relation does not exist" (42P01): how to fix it
Error 42P01? Fix tables missing in the live project, migrations that never ran, the wrong project, schema names and capital letters.
Supabase Realtime not working (no changes received): how to fix it
Subscribed but nothing arrives? Fix the realtime publication, RLS policies, auth tokens, filters, DELETE events and React cleanups.
Supabase "User already registered" (or sign up silently does nothing): how to fix it
Sign up errors for an existing email, or "succeeds" with no email? Detect existing accounts, handle Google users and clean up test accounts.
Supabase "Could not find the column in the schema cache" (PGRST204): how to fix it
PGRST204 on insert/update? Fix camelCase vs snake_case, nested inserts, missing migrations and a stale PostgREST cache.
Supabase "duplicate key value violates unique constraint" (23505): how to fix it
HTTP 409 / 23505 on insert? Refuse with a friendly message, upsert with onConflict, or fix a stuck serial after import.
Supabase "Invalid API key": how to fix it
401 Invalid API key from your app? Check the right project, missing host variables, stray spaces, disabled legacy keys and secret keys in the browser.
Vercel "No Output Directory named dist found": how to fix it
Build passes but the deploy fails? Fix the output directory, framework preset, root directory and vercel.json override.
Supabase "Invalid login credentials": how to fix it
Wrong password error with the right password? Check the right project, Google-only accounts, unconfirmed emails and signups that never saved a password.
Supabase "Email link is invalid or has expired" (otp_expired): how to fix it
Confirmation or magic link fails on first click? Fix email scanners, PKCE across devices, expiry and redirect URLs.
Supabase "JSON object requested, multiple (or no) rows returned" (PGRST116): how to fix it
PGRST116 from .single()? Use .maybeSingle(), fix RLS hiding rows, and add unique constraints so duplicates cannot pile up.
Supabase "Database error saving new user": how to fix it
AuthApiError on signup? Fix the handle_new_user trigger (security definer), create public.profiles, and read the real Postgres error.
Supabase "infinite recursion detected in policy": how to fix it
HTTP 500 with infinite recursion detected in policy (42P17)? Break the RLS loop with a private security definer helper. Common in Lovable and Bolt admin policies.
Supabase "JWT expired": how to fix it
401 JWT expired after about an hour? Stop copying access tokens into headers; let supabase-js and @supabase/ssr refresh the session.
Supabase storage upload fails: 403 "new row violates row-level security policy"
File or image uploads failing in your Lovable, Bolt or Cursor app with a 403 'new row violates row-level security policy'? Add the right storage.objects policies, fix the upload path and upsert. Safe fix, no disabled RLS.
Google sign-in "Error 400: redirect_uri_mismatch" after deploy: how to fix it
Google login shows 'Error 400: redirect_uri_mismatch' on your live Lovable, Bolt or Cursor app? Add the right callback URL in Google Cloud, Supabase redirect URLs and your live domain. Step-by-step.
API key exposed in your Lovable, Bolt or Cursor app: how to hide it
Your OpenAI, Stripe secret or other API key is visible in the browser of your AI-built app? Find it, rotate it and move the call to a server or Supabase Edge Function. Step-by-step.
Stripe works in test mode but not in live mode: how to fix it
Checkout worked with test cards, but live payments fail with "No such price", "a similar object exists in test mode", or webhooks that never arrive. Fix keys, price IDs, webhooks and env variables for Lovable, Bolt and Cursor apps.
Supabase's 30 October change: has your project switched, and what breaks
Check whether your project has stopped auto-granting new tables, and fix the hidden breaks: recreated tables, new views, service_role and preview branches.
Supabase "new row violates row-level security policy for table": how to fix it
Insert or update blocked by RLS (42501)? Add the right INSERT policy, set user_id, and fix upsert and insert().select().
Supabase "AuthSessionMissingError: Auth session missing!": how to fix it
getUser, password reset or sign-out says Auth session missing? Fix server clients, reset links and timing.
Supabase "TypeError: Failed to fetch": how to fix it
App suddenly says Failed to fetch or AuthRetryableFetchError? Fix a paused project, missing env vars, CORS and blocked networks.
Supabase "Could not find the table in the schema cache" (PGRST205): how to fix it
Table or column missing from the schema cache (PGRST205 or PGRST204)? Apply the migration, reload the cache and check names.
Supabase "Edge Function returned a non-2xx status code": how to fix it
Lovable or Bolt app says Edge Function returned a non-2xx status code? Find the real error in the logs, then fix missing secrets, 401s, CORS and crashes.
Supabase confirmation or magic link redirects to localhost: how to fix it
Sign-up, magic link or reset emails send users to localhost:3000? Fix Site URL, Redirect URLs and emailRedirectTo in Lovable, Bolt and Cursor apps.
Supabase "Invalid Refresh Token: Refresh Token Not Found": how to fix it
Users logged out at random, or AuthApiError: Invalid Refresh Token in the console? Fix duplicate Supabase clients, stale sessions and Next.js middleware in Lovable, Bolt and Cursor apps.
Vercel build failed with "npm run build" exited with 1: how to fix it
Works locally but Vercel says Command "npm run build" exited with 1? Find the real error and fix TypeScript, lint, file-name case, env variables, lockfiles and Node version.
Supabase "RLS disabled in public" warning: how to fix it safely
Security Advisor says "RLS Disabled in Public"? Turn on row level security without breaking your Lovable or Bolt app, then add the policies it needs. Step-by-step.
Next.js "Hydration failed because the server rendered HTML didn't match the client": how to fix it
"Hydration failed" or "Text content does not match" in your Next.js app? The usual causes in Cursor, v0 and Bolt apps: dates, browser-only code, bad HTML nesting. Step-by-step.
Supabase "Legacy API keys are disabled": switch to publishable and secret keys
The anon and service_role keys are being retired by the end of 2026. Switch to sb_publishable_ and sb_secret_ keys in your app, Edge Functions and webhooks without breaking anything.
Vercel 504 "FUNCTION_INVOCATION_TIMEOUT": how to fix it
Your Lovable, Bolt, Cursor or v0 app works locally but Vercel returns 504 FUNCTION_INVOCATION_TIMEOUT or "Task timed out". Find the slow call, raise maxDuration, stream AI responses and move long jobs out of the request.
Custom domain not working on Vercel, Netlify or Lovable: how to fix it
Custom domain shows 'Invalid Configuration', an SSL error or the old site? Fix A and CNAME records, www vs root, nameservers and stuck certificates for Vercel, Netlify and Lovable. Step-by-step.
Supabase returns empty data after deploy (no error)
No error, just empty lists? RLS is filtering every row. Confirm it and add the right policy without turning RLS off.
Stripe webhook not working in production
Payments go through but the account never upgrades. Live-mode endpoints, signature errors, Edge Functions and RLS.
Supabase confirmation emails not arriving
The built-in sender only emails your own team. Set up custom SMTP and fix the links inside the email.
The 10-point check before you launch your Lovable + Supabase app
A practical pre-launch checklist for Lovable + Supabase apps: RLS, storage policies, second-account test, service_role key, auth redirect URLs, env vars, email links, Stripe webhooks, error states and backups. Each with a one-line way to check.
Replit app broken after deploy or republish: how to fix it
Your Replit app works in Preview but fails when published or after a republish. How to read the deployment logs, fix missing production secrets, port and health check errors, then republish safely.
Supabase too many connections: how to fix it
Supabase errors like 'remaining connection slots are reserved' or 'Max client connections reached' usually come from serverless functions. How to use the pooler on port 6543, shrink pool sizes, find what holds connections and monitor it.
Supabase "permission denied for table" (42501) on a new table: how to fix it
New Supabase tables now need explicit grants before your app can reach them. Why Lovable and Bolt apps hit error 42501 even with RLS policies, the safe grants to add, and the prompt that stops it happening again.
Supabase view bypasses RLS: how to lock it down
A Postgres view in Supabase can ignore row level security and even let the public anon key update or delete rows. How to find risky views, set security_invoker, revoke writes and test it.
Supabase auth redirect loop on Vercel: how to fix it
Login works in preview but loops back to the sign-in page (or to localhost) after you deploy to Vercel? The usual causes are Supabase URL settings, OAuth redirect URIs and session cookies. Step-by-step fix.
Blank page after deploying a Vite app: how to fix it
White screen after deploying your Lovable, Bolt or v0 Vite app to Vercel or Netlify? Check VITE_ env vars, redeploys, the base path and SPA rewrites. Step-by-step fix.
Environment variables undefined in production on Vercel: how to fix it
process.env or import.meta.env undefined after deploying your Lovable, Bolt, Cursor or v0 app to Vercel? Fix prefixes, environments, redeploys and server vs browser code. Step-by-step.
CORS error after deploy (Supabase, API, Edge Functions): how to fix it
Blocked by CORS policy after deploying your Lovable, Bolt or Cursor app? Fix Supabase Edge Function headers, OPTIONS preflight, allowed origins and wrong API URLs. Step-by-step.
Stripe success page unlocks paid access for free: how to fix it
Unlocking paid features on your Stripe /success page lets anyone in free and locks out real customers. How to grant access with a verified webhook in Next.js and Supabase.
Still stuck? Get a free scan and we'll tell you what's broken and what a fix costs.