Fix common deploy errors

The errors that show up right after you move an AI-built app to real hosting, with exact fixes from official docs. Paste what you see, or pick the tool you built with.

14 fixes

  • Supabase warns “RLS disabled” — your table is public

    Supabase dashboard or Security Advisor shows “RLS disabled” / “Table publicly accessible” Critical Supabase table without Row Level Security

    What you see

    • Supabase dashboard or Security Advisor shows “RLS disabled” / “Table publicly accessible”
    • Lovable's security scan flags a table on publish
    • Anyone with your public (anon/publishable) key can read or change every row

    Why it happens

    Your Supabase public key is shipped to every visitor's browser — that's by design. Row Level Security (RLS) is what decides which rows each visitor may touch. A table in an exposed schema without RLS is readable and writable by any role that has been granted access to it.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0, Replit.

    Start here: Turn on RLS for the table

    In the SQL editor run this for each table (or toggle RLS in Table Editor). With RLS on and no policies, the public key can no longer read anything — that's expected.

    alter table public.todos enable row level security;
    Read all 4 steps
  • “new row violates row-level security policy” (42501)

    Error: new row violates row-level security policy for table "…" High Insert/update blocked by RLS

    What you see

    • Error: new row violates row-level security policy for table "…"
    • Postgres error code 42501
    • Reads work but saving data fails after deploying

    Why it happens

    RLS is on (good) but there is no INSERT/UPDATE policy that allows this user to write this row — or the user isn't signed in on the deployed site, so auth.uid() is null.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0.

    Start here: Add an INSERT policy with a WITH CHECK clause

    create policy "Users insert own rows"
    on public.todos for insert
    to authenticated
    with check ( (select auth.uid()) = user_id );
    Read all 4 steps
  • Bolt “database permissions error” on a new table: the October 30 private-by-default change

    Bolt shows a database permissions error after it adds a new table to your project High Bolt database permissions error on tables created after 30 Oct 2026

    What you see

    • Bolt shows a database permissions error after it adds a new table to your project
    • Data from a table created after 30 October 2026 won't load or save, while older tables still work
    • The preview or published site breaks right after you ask Bolt for a new feature that needs a new table

    Why it happens

    Bolt's release notes say that starting 30 October 2026, Bolt database keeps tables private by default, and your app needs explicit permissions to read or write them. It applies only to tables created after 30 October; existing databases aren't affected. Bolt should set up the right permissions when it creates a new table, and when it doesn't, the app gets a permissions error instead of the data. That's the safe way to fail: the table is closed, not exposed. Projects connected to your own Supabase database (Pro and Teams) are covered by Supabase's own 30 October grants change, which shows up as Postgres error 42501 “permission denied for table”.

    Seen with Bolt.new.

    Start here: Ask Bolt to fix the permissions, and only for that table

    Bolt's documented fix is to ask Bolt to fix the table permissions. Name the table and say who should be able to do what, so the agent doesn't open more than it needs to. Our suggested prompt (not Bolt's wording):

    My app shows a database permissions error on the <table_name> table,
    which was created after October 30. Give the app only the read and write
    permissions this feature needs on that table. Signed-in users should only
    read and change their own rows. Don't make any other table public.
    Read all 6 steps
  • Supabase paused my project: how to restore it and stop it happening

    Email from Supabase: your project will be paused, then that it has been paused High Supabase Free project paused for inactivity

    What you see

    • Email from Supabase: your project will be paused, then that it has been paused
    • Dashboard shows the project as paused with a Resume project button
    • Your live app can't sign anyone in or load data, though the frontend still loads

    Why it happens

    Supabase pauses Free plan projects that get too little database activity over a 7-day period. It doesn't publish an exact threshold; its docs say a few user requests to the database each day are typically enough to avoid it. Projects on a paid plan are never paused for inactivity.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0, Replit.

    Start here: Take your own backup while it's running

    The pricing page lists daily backups (kept 7 days) on Pro, not on Free. Dump the schema and data with the Supabase CLI and keep the files with your code, so a lost project is a rebuild, not a disaster.

    npx supabase login
    npx supabase link --project-ref <your-project-ref>
    npx supabase db dump -f supabase/schema.sql
    npx supabase db dump --data-only -f supabase/data.sql
    npx supabase db dump --role-only -f supabase/roles.sql
    Read all 5 steps
  • Stripe webhook fails on a Supabase Edge Function: 401 or “No signatures found”

    Stripe's Event deliveries tab shows failed deliveries with HTTP 401, and the function's logs show nothing from your code High Stripe webhooks to a Supabase Edge Function fail

    What you see

    • Stripe's Event deliveries tab shows failed deliveries with HTTP 401, and the function's logs show nothing from your code
    • The response body is {"code":401,"message":"Missing authorization header"} or mentions an invalid JWT
    • Or a 400 with No signatures found matching the expected signature for payload
    • Or the error SubtleCryptoProvider cannot be used in a synchronous context
    • Customers pay in Stripe, but the app never marks the order or subscription as paid

    Why it happens

    Supabase Edge Functions check for a valid Supabase JWT before your code runs (verify_jwt, on by default), and Stripe can't send one, so the platform answers 401 and your handler never sees the event. Once requests get through, Stripe's signature check fails if the code parses the body before verifying it, calls the synchronous constructEvent in Deno, or uses the signing secret of a different endpoint (the Stripe CLI, a sandbox or live mode each have their own).

    Seen with Lovable, Bolt.new, Cursor, Claude Code, v0.

    Start here: Turn off JWT verification for the webhook function only

    Supabase's docs use exactly this case as the example: Stripe webhooks must be publicly reachable because Stripe has no user token. Set verify_jwt = false for that one function in supabase/config.toml and redeploy, or deploy it with --no-verify-jwt. Keep verification on for functions your users call; the Stripe signature check in the next step becomes this function's authentication.

    # supabase/config.toml
    [functions.stripe-webhook]
    verify_jwt = false
    
    # then deploy (the flag does the same thing)
    npx supabase functions deploy stripe-webhook --no-verify-jwt
    Read all 7 steps
  • SQLite database resets after every deploy: why production data disappears

    New sign-ups, posts or orders vanish after a redeploy, a restart or an idle spin-down Critical SQLite data disappears after a deploy or restart

    What you see

    • New sign-ups, posts or orders vanish after a redeploy, a restart or an idle spin-down
    • Production shows your local test data again after every push
    • On Vercel, writing the .db file fails with a read-only file system error

    Why it happens

    SQLite keeps the whole database in one file on the server's disk, and most hosts don't keep that disk. Vercel Functions get a read-only filesystem with only temporary /tmp scratch space, and separate instances don't share storage. Container hosts such as Railway, Render and Fly.io start each deploy on a fresh, ephemeral filesystem unless you attach a volume or disk. And if the .db file is committed to Git, each deploy ships your local copy over whatever production had.

    Seen with Cursor, Claude Code, Devin Desktop, v0.

    Start here: Stop shipping the database file with your code

    Add the database file to .gitignore and remove it from the repository (this keeps your local copy). Otherwise every push replaces production data with your laptop's test data, even on a host with persistent storage.

    echo "*.db" >> .gitignore
    echo "*.db-journal" >> .gitignore
    git rm --cached path/to/your.db
    git commit -m "Stop committing the SQLite database"
    Read all 6 steps
  • Page works, but refreshing it gives a 404

    Home page loads, but /dashboard or /login shows “Page not found” when refreshed or opened directly Medium SPA routes 404 on refresh/direct link

    What you see

    • Home page loads, but /dashboard or /login shows “Page not found” when refreshed or opened directly
    • Netlify “Page not found”, Vercel 404: NOT_FOUND, or an Apache 404 on shared hosting

    Why it happens

    Single-page apps (React + Vite, React Router) have one real file — index.html. Routes like /dashboard exist only in JavaScript. When you refresh, the host looks for a file called /dashboard, doesn't find one and returns 404. You need a rewrite that serves index.html for unknown paths.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, Replit.

    Start here: Add the fallback rule for your host

    Pick your host below. Put the file in your project's public/ folder (Vite copies it into dist/) and redeploy.

    Read all 2 steps
  • Lovable app builds on Vercel but every page is a 404 (TanStack Start)

    The Vercel build finishes green, but the live URL shows Vercel's own 404 page High Lovable TanStack Start app shows 404 on Vercel

    What you see

    • The Vercel build finishes green, but the live URL shows Vercel's own 404 page
    • The home page loads, but other routes return 404 when opened directly or refreshed
    • Server-rendered pages or server functions fail, while the same project works on Lovable's hosting

    Why it happens

    Lovable projects created from May 13, 2026 are TanStack Start apps, which need a host that runs their server code, so Vercel must receive a server build rather than a folder of static files. Lovable's build config (@lovable.dev/vite-tanstack-config) uses Nitro to produce that build for each platform, and Vercel's zero-configuration detection needs version 2.6.2 or newer. An older build config, a missing nitro package, a preset forced to another platform, or a Vercel project set up like a plain static Vite site leaves Vercel with no routes to serve.

    Seen with Lovable.

    Start here: Update Lovable's build config and make sure Nitro is installed

    Vercel's Lovable docs say zero-configuration detection needs @lovable.dev/vite-tanstack-config at ^2.6.2 or higher. Lovable's docs say to check that package.json lists nitro: without it, the build does not package the app, and older build configurations can skip Nitro outside Lovable or write a different output folder. Commit package.json together with the updated lockfile.

    npm install "@lovable.dev/vite-tanstack-config@^2.6.2" nitro
    git add package.json package-lock.json
    git commit -m "Update Lovable build config for Vercel"
    git push
    Read all 7 steps
  • Blank page or “supabaseUrl is required” after moving off the builder

    White/blank page in production; console shows “supabaseUrl is required” or undefined API keys High Environment variables missing after export

    What you see

    • White/blank page in production; console shows “supabaseUrl is required” or undefined API keys
    • App worked inside Lovable/Bolt/Replit but not on Netlify/Vercel/Cloudflare
    • You added variables in the dashboard but nothing changed

    Why it happens

    Builders inject keys for you; your .env file is (correctly) not in Git, so the new host builds without them. With Vite, only variables starting with VITE_ are exposed to browser code, and they're replaced at build time — so changing them requires a rebuild.

    Seen with Lovable, Bolt.new, Replit, v0, Cursor, Claude Code, Devin Desktop.

    Start here: Find the variable names your code uses

    Search the code for import.meta.env (Vite) or process.env (Node/Next.js). Lovable projects typically use VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY and VITE_SUPABASE_PROJECT_ID.

    grep -rn "import.meta.env\|process.env" src
    Read all 4 steps
  • Works locally, but "Failed to fetch" after deploying: your app still calls localhost

    Browser console: TypeError: Failed to fetch or net::ERR_CONNECTION_REFUSED for a http://localhost:… URL High API calls fail in production because they still go to localhost

    What you see

    • Browser console: TypeError: Failed to fetch or net::ERR_CONNECTION_REFUSED for a http://localhost:… URL
    • Sign-up, login or data loading works on your computer but fails on your phone or anyone else's device
    • After you fix the URL: has been blocked by CORS policy or a Mixed Content warning in the console
    • The backend host shows Application failed to respond or a 502 instead of your API

    Why it happens

    localhost always means the device running the code. AI tools write http://localhost:3001/api/... into the frontend because that's where the backend ran while you built the app, so on your computer it works. In production every visitor's browser tries to reach a server on their own device, which doesn't exist. Fixing the address often uncovers three follow-ups: the API must allow your site's origin (CORS), an HTTPS page can't call an http:// API (mixed content), and the backend has to listen on the address and port the host gives it.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0, Replit.

    Start here: Find every hardcoded local URL

    Search the frontend for localhost and 127.0.0.1. Check fetch calls, axios instances, API client files and .env files that were committed with development values.

    grep -rnE "localhost|127\.0\.0\.1" src .env* 2>/dev/null
    Read all 8 steps
  • Google login sends you back to localhost (or “redirect_uri_mismatch”)

    After signing in with Google you land on http://localhost:3000 High OAuth redirect URL mismatch

    What you see

    • After signing in with Google you land on http://localhost:3000
    • Error 400: redirect_uri_mismatch
    • Login works on the builder's preview URL but not on your domain

    Why it happens

    Two lists must include your live URL: your auth provider's allowed redirect URLs (Supabase's Site URL defaults to http://localhost:3000) and, for Google, the Authorized redirect URI in Google Cloud, which must be Supabase's callback URL.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0, Replit.

    Start here: Supabase: set Site URL and Redirect URLs

    Dashboard → Authentication → URL Configuration. Set Site URL to your production domain and add every domain you use to Redirect URLs. Wildcards are supported for preview deploys.

    Site URL:       https://yourdomain.com
    Redirect URLs:  https://yourdomain.com/**
                    https://**--my_org.netlify.app/**   # Netlify previews
    Read all 4 steps
  • Deploy succeeds but shows a blank page or “Page not found”

    Build log is green but the site is blank, lists files, or 404s at / Medium Wrong build command or output directory

    What you see

    • Build log is green but the site is blank, lists files, or 404s at /
    • Error: “No output directory named 'build' found” / “publish directory does not exist”

    Why it happens

    The host built your project but served the wrong folder. Vite outputs dist/, Create React App outputs build/, Next.js static export outputs out/. A wrong setting serves your raw source (blank page) or nothing.

    Seen with Lovable, Bolt.new, Cursor, Claude Code, Devin Desktop, v0, Replit.

    Start here: Check what your build actually produces

    npm run build
    ls        # look for dist/, build/ or out/
    Read all 4 steps
  • Firebase: “This domain is not authorized for OAuth operations”

    auth/unauthorized-domain High Firebase Auth unauthorized domain

    What you see

    • auth/unauthorized-domain
    • Google sign-in popup closes immediately on your deployed site

    Why it happens

    Firebase only allows sign-in from domains on the Authorized domains list. Your new hosting domain isn't on it. Projects created after April 28, 2025 also don't include localhost by default.

    Seen with Cursor, Claude Code, Devin Desktop, v0, Bolt.new.

    Start here: Add your domain

    Firebase console → Authentication → Settings → Authorized domains → Add domain. Add the bare domain (yourdomain.com), plus any preview domain you use.

    Read all 3 steps
  • Clerk: “Development keys” warning or sign-in broken in production

    Console warning that Clerk has been loaded with development keys Medium Clerk development keys in production

    What you see

    • Console warning that Clerk has been loaded with development keys
    • Social login works locally but not on your domain
    • Keys start with pk_test_ / sk_test_ on the live site

    Why it happens

    Clerk development instances are for local testing and have usage limits. Production needs a production instance with its own keys, your own domain verified via DNS, and your own OAuth credentials for social providers.

    Seen with Cursor, Claude Code, Devin Desktop, v0.

    Start here: Swap env vars and redeploy

    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_...
    CLERK_SECRET_KEY=sk_live_...
    Read all 4 steps

Hit an error that is not here? Send it to us with the exact message and the tool you used.