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.appaddress 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:
- In Vercel, open the project's Settings, then Environment Variables, and add each variable your app reads, such as
VITE_SUPABASE_URLand the publishable key, for the Production environment (and Preview if you test there). - Redeploy. Adding a variable does nothing until a new deployment is built.
- 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.