# Lovable app won't publish or shows old changes: the six causes and the fix for each

Most of the "my Lovable app won't deploy" messages I see come down to one of a handful of causes. Some are inside Lovable (the change was never published, the build failed, a security scan or a workspace policy blocked it). The rest happen when you move the app to Vercel, Netlify or Cloudflare and the host is set up for the wrong kind of build.

Here is how I find which one it is, and the fix for each.

## The messages you might see

- `Publishing failed`
- `Fix security issues to publish`
- `Publishing is blocked by workspace policy`
- `You don't have permission to publish this project`
- Or no message at all: the deploy on Vercel or Netlify fails, or the live site still shows old changes.

## Why it happens

- **The changes were never published.** Lovable does not push edits to the live site by itself, and accepting a draft does not publish it. A small dot on the Publish button means there are unpublished changes.
- **The build fails.** An error in the code stops the deploy. The Publish button turns into **Try to fix**, or a **Publishing failed** banner appears.
- **A security scan blocks it.** The Publish dialog runs a quick security scan. Its findings don't block publishing by default, but with **Block publishing with critical issues** turned on, you get **Fix security issues to publish** until the critical findings are resolved.
- **A policy or a missing permission blocks it.** By default editors and above can publish. On Enterprise workspaces a policy can require approval (**Publish requires approval**) or block publishing.
- **The outside host is set up for the wrong kind of app.** A React and Vite project from Lovable builds static files into `dist`. A TanStack Start project needs a host that runs a server, and its build fails if `nitro` is missing from `package.json`.
- **Build-time values are missing.** `VITE_SUPABASE_URL` and `VITE_SUPABASE_PUBLISHABLE_KEY` are written into the app when it builds. Set them after the build, or not at all, and the app loads but can't reach its backend.

## Find the cause first

1. Open the Publish dialog and read what it says. **Publishing failed**, **Try to fix**, **Fix security issues to publish** and a policy message each point to a different cause above.
2. Look for the dot on the Publish button. If it's there, the live site is behind the editor.
3. Visit the exact published address. Changing the URL subdomain moves the site to a new address, and a new custom domain serves the app only once it shows **Live**.
4. On Vercel, Netlify or Cloudflare, open the failed deploy's build log and read the **first** error, not only the last line.
5. Open `package.json` in the Code tab. `@tanstack/react-start` means a TanStack Start app that needs a server; otherwise it's a React and Vite app that builds to static files.

## Fix 1: Publish from Lovable, then publish every change

1. Click **Publish** (top right, next to Share), check the Website URL and who can see the site, then click **Publish**. The dialog says **Your website is live** when the deploy finishes.
2. For every later change, open the Publish dialog again and click **Publish changes**.
3. If a **Publishing failed** banner appears, use what it offers: **Try again** for a temporary problem, **Try to fix** for an error in the app or its configuration, and **Ask the assistant to help** for a database conflict. Internal errors go to Lovable support.

## Fix 2: Clear a build error or a blocked publish

1. Click **Try to fix**, or paste the exact error into the chat and ask Lovable to fix only that error.
2. If the dialog says **Fix security issues to publish**, open the scan findings and fix the critical ones rather than turning the block off.
3. For **Publish requires approval** or **Publishing is blocked by workspace policy**, ask a workspace admin. For **You don't have permission to publish this project**, ask for editor access.
4. If the build keeps failing after each fix, open **History**, revert to the version marked **Published** (the last one that went live) and make the change again in smaller steps. Reverting restores code, not database data.

## Fix 3: Deploy outside Lovable (Vercel, Netlify, Cloudflare)

1. Connect the project to GitHub with Git sync, then import that repository on the host.
2. For a React and Vite app, use the build command `npm run build`, the output directory `dist` and Node 22.
3. If `npm ci` fails because the repository has only `bun.lock`, build with Bun, or generate and commit a `package-lock.json`.
4. Set the `VITE_` values from the project's `.env` file on the host **before** the build, and redeploy after any change: they are fixed at build time.
5. Add the fallback that serves `index.html` for app routes (a `_redirects` file on Netlify and Cloudflare, `vercel.json` on Vercel), and add the new domain to your sign-in provider's allowed redirect URLs.
6. For a TanStack Start app, use a host that runs a server (Vercel, Netlify and Cloudflare Pages detect it automatically) and check that `nitro` is in `package.json`.

These are the settings for the common case:

```
React + Vite app from Lovable, on Vercel, Netlify or Cloudflare Pages

Build command     npm run build
Output directory  dist
Node version      22
Environment       VITE_SUPABASE_URL
                  VITE_SUPABASE_PUBLISHABLE_KEY
                  VITE_SUPABASE_PROJECT_ID
                  (values from the project's .env file, set before the build)
```

## Check the fix worked

- The Publish dialog says **Your website is live**, and the Publish button shows no dot.
- Open the published address in a private window: your latest change is there.
- On an outside host, open a deep link directly and refresh it: the page loads instead of a 404.
- Sign in on the live domain: you come back to the app, not to the preview address or localhost.

## Stop it coming back

- Check the live address after you publish, not only the preview.
- Ask a workspace admin or owner to turn on **Block publishing with critical issues** (Workspace settings > Security), so a change with critical findings can't go live unnoticed.
- Keep the project in GitHub with Git sync, so an outside host builds every push and a failed build shows up at once.

## Quick answers

**Why does my Lovable app work in the preview but not on the live site?** The preview shows the version you're editing; the live site is the snapshot you last published. Click **Publish changes** to update it, and check you're visiting the exact published address.

**Can I deploy a Lovable app to Vercel or Netlify?** Yes. Connect it to GitHub with Git sync and import the repository; a React and Vite app builds with `npm run build` into `dist` on Node 22. The frontend can move while the app keeps using its Lovable Cloud backend.

**Do I need a paid plan to publish?** No. Free and Pro projects can publish with public or invite-only access. Connecting a custom domain needs a paid plan.

Sources: [Lovable: Publish your Lovable project](https://docs.lovable.dev/features/publish), [Lovable: Deploying and hosting outside Lovable](https://docs.lovable.dev/tips-tricks/external-deployment-hosting), [Lovable: Revert and restore your project with version history](https://docs.lovable.dev/features/projects/history).

I keep the full checklist, with related fixes for 404s on refresh and undefined env variables, on [our fix page](https://stacksmesh.com/fix/lovable-app-not-deploying?utm_source=hashnode&utm_medium=article&utm_campaign=BR-0003). Once it's live, you can run the free [Launch Check](https://stacksmesh.com/tools/launch-check?utm_source=hashnode&utm_medium=article&utm_campaign=BR-0003) on the published address to catch exposed keys and missing security headers.

I wrote this with AI assistance and reviewed it myself.

