Skip to content
PixelRidge
← All guides

4 October 2026 · 5 min read

Lovable app not working after deploy? The common causes and how to fix each one

A blank page, a 404 on refresh, missing data or a login that fails after you publish or move a Lovable app. The causes we check first, in order, with the fix for each and sources for every platform detail.

Short answer: Most Lovable apps that break after a deploy fail for one of four reasons: the live site is an older snapshot than the preview, the environment variables didn't come across to the new host, the host doesn't know how to serve your app's page routes, or the backend (login, database rules, redirect URLs) was set up for the old address. Work through them in that order, because each takes minutes to check. This guide is based on the platform documentation linked below, as of October 2026.

First, work out which deploy you mean

"Deploy" means two different things for a Lovable app, and the fixes differ.

  • You pressed Publish in Lovable and the live lovable.app address looks wrong or out of date. Start with cause 1.
  • You moved the app to your own Vercel or another host (see our guide to self-hosting a Lovable app). Start with cause 2.

1. The live site is an old snapshot

Lovable's documentation says that only the current version is deployed, and "later changes are not automatically pushed live" (Lovable docs). Each publish deploys a snapshot, and a small dot appears on the Publish button when your project has changes newer than the live version.

Fix: open Publish and use "Publish changes". If the dialog says "Build errors need fixing", the latest changes failed to build, so nothing new can go live until you fix the build error. The docs also warn that a database change in a publish can conflict with data already in your live database, which blocks the deploy until it is reconciled.

2. Environment variables didn't move with the app

On Vite apps, only variables whose names start with VITE_ are exposed to the browser, and their values are baked in at build time (Vite docs). On Vercel, a change to an environment variable doesn't apply to earlier deployments, only to new ones (Vercel docs).

Symptoms: a blank page, "Failed to fetch", or a Supabase client that complains it has no URL or key.

Fix:

  1. In Vercel, open the project's Settings, then Environment Variables, and add each variable your app reads, such as VITE_SUPABASE_URL and the publishable key, for the Production environment (and Preview if you test there).
  2. Redeploy. Adding a variable does nothing until a new deployment is built.
  3. Check the browser console on the live site for the exact missing name.

One safety point: Vite warns that VITE_* values "should not contain sensitive information such as API keys", because they end up in your public code. A Supabase publishable key is designed to be public. A service-role or secret key is not, and must never carry a VITE_ prefix. See Supabase's new publishable and secret keys if you aren't sure which one you have.

3. Page routes return 404 when you refresh

If your app is a single-page app, Vercel's documentation says deep linking "won't work out of the box" (Vercel docs). The home page loads, but opening /dashboard directly, or refreshing it, gives a 404.

Fix: for a Vite single-page app, Vercel's documented fix is a vercel.json file at the project root that rewrites every path to index.html:

{
  "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
}

Commit it and redeploy. If your project uses a server-rendered framework such as TanStack Start instead of a plain Vite single-page app, this file is not the right fix, and the deploy needs the framework's own Vercel setup. Check which one your project is before you copy the snippet.

4. The backend still points at the old address

Lovable's backend runs separately from its hosting (Lovable docs). That means moving the front end doesn't move your login rules. After a move, check:

  • Auth redirect URLs. In Supabase, the Site URL and redirect URLs must include your new domain, or sign-in and password-reset links send people to the old one.
  • Row Level Security. Policies that worked in the preview can still block real users. If lists load empty or saves fail while you are logged in, see the Supabase RLS error guide.
  • Webhooks. A payment provider still calling the old address will silently fail. For Stripe, see our webhook error guide.

5. The build works in Lovable but fails on your host

Build logs are the fastest diagnosis. Open the failed deployment in Vercel and read the first error, not the last. Two checks that often explain it:

  • Node version. Set the version in Vercel's project settings to one your dependencies support.
  • File name case. Some computers ignore capital letters in file names and Linux servers don't, so an import written as ./components/Header can fail when the file is header.tsx.

When to stop and get help

If you have checked all five and the app is still broken, or if you can't tell whether a key in your code is safe to publish, stop changing things. Repeated edits and redeploys can leave the app in a worse state than where it started. Our Lovable fix page lists what we check, and Rescue & Migration covers moving an app onto its own hosting.

FAQ

Why does my Lovable preview work but the published site doesn't? The most common reason is that the published site is an older snapshot, or that the latest publish failed to build. Lovable's docs say changes after a publish don't go live until you publish again (Lovable docs).

Why is my Lovable app blank on Vercel? Usually missing environment variables. They have to be added in Vercel and the app redeployed, because changes only apply to new deployments (Vercel docs).

Why do I get a 404 when I refresh a page? A single-page app needs a rewrite so Vercel serves index.html for every path (Vercel docs).

Is it safe to put my Supabase key in a VITE_ variable? The publishable (anon) key is meant to be public, but secret and service-role keys never are. Anything with a VITE_ prefix ends up in your public code (Vite docs).


Still stuck? Start with the free Launch Check, or try our pricing calculator for an estimate.

Sources: Lovable: Publish, Lovable: How Lovable hosts your app, Vite: Env variables and modes, Vercel: Environment variables, Vercel: Vite on Vercel. Checked October 2026.

Rather get it by email?

Leave your name and email, plus your app link if you like. We reply with a free Launch Check, no obligation.

We email you about this request only, and you can reply “unsubscribe” at any time. Prefer email? Write to info@pixelridgeweb.com. See our privacy notice.

Want a second pair of eyes on your app?

Send us your live link. We record a short video showing the top risks we can see, free and with no obligation.

Terms and conditions apply. Read the terms.