Hire Lovable Xperts
Deployment

Lovable Won't Publish? How to Break the Stale-Commit Deploy and Get Your Changes Live

If Lovable keeps serving an old commit, shows 'Oops! couldn't publish your site', or your changes never reach production, your code is almost certainly fine. The publish step is failing or a stale cache is being served. This is the Stale-Commit Deploy: the live URL is pinned to a build that no longer matches your source. The fix is a hard redeploy plus a cache bust, in that order.

By Founder Name · Last verified: 2026-06-25

Why is Lovable still serving an old commit after I published?

Because publishing and serving are two separate steps, and one of them stalled. Either the publish job failed silently and the previous build is still live, or the publish succeeded but a CDN or browser cache is still handing out the old bundle. Your source is correct in the editor — what users see is a frozen snapshot from an earlier commit that the serving layer never replaced.

We call this the Stale-Commit Deploy: the live URL is pinned to a build that no longer matches your latest source. It happens because Lovable's preview reads your current files directly, while the published site reads a compiled, cached artifact. When the publish pipeline does not complete — or completes but the cache is not invalidated — the gap between the two becomes invisible. You keep editing, the preview keeps updating, and production stays exactly where it was three commits ago.

The most reliable tell is a side-by-side check: load the editor preview and the published URL in two tabs. If a change you made shows in the preview but not on the live domain, you are serving a stale commit. The next question is only whether the publish failed or the cache is stale — the two need different fixes.

Stale-Commit Deploy Diagnostic Table
SymptomMost Likely CauseFirst Fix
'Oops! couldn't publish your site'Publish job failed — build error or platform hiccupRe-run publish; check the build log for the failing step
Publish says success but live URL unchangedCDN or browser cache still serving old bundleHard refresh, then purge the host cache and re-publish
Preview updated, production frozenStale-Commit Deploy — serving layer never swapped buildsHard redeploy from a clean commit
Changes live for you, old for usersBrowser cache on your machine onlyTest in an incognito window before assuming a real stale deploy
Publish hangs and never completesBuild step stuck or platform queue backlogCancel, wait, then trigger a fresh publish
Custom domain old, lovable.app URL newDomain pointed at a stale build or wrong host cacheRe-verify domain target and purge its cache
Old commit returns after a working deployGitHub sync mismatch — host built the wrong refConfirm the deployed commit hash matches your branch HEAD

How do I confirm it's a stale cache and not a broken build?

Run a three-tab test before changing anything. Open the editor preview, the published URL in a normal browser, and the published URL in an incognito window. If the change appears in the preview and incognito but not your normal tab, it is only your local browser cache. If it appears nowhere on the live domain, the publish itself did not ship — and that is the real Stale-Commit Deploy.

Incognito matters because your everyday browser aggressively caches JavaScript bundles. A change that looks unpublished is frequently just a stale service worker or HTTP cache on one machine. Ruling that out first saves you from a needless redeploy. If incognito shows the new version, clear your site data and you are done — no platform issue at all.

If incognito still shows the old commit, open the published page, open DevTools, and check the loaded bundle filename in the Network tab. Compare it across a hard refresh. If the same hashed filename keeps loading after you publish, the host is serving a cached artifact and never picked up the new build — confirm with the deployed commit hash if your host exposes one.

Quick rule: editor preview reads live files, the published URL reads a cached build. A mismatch between them is the signature of the Stale-Commit Deploy, not a code bug. Do not re-prompt Lovable to rebuild your app — the code is not the problem.

What does 'Oops! couldn't publish your site' actually mean?

It means the publish job started and then failed before producing a deployable build. Lovable could not compile or upload the new artifact, so it left the previous one live to avoid taking your site down. The error is generic on purpose — the real reason is in the build log: most often a TypeScript error, a failed dependency install, or a transient platform timeout you can simply retry.

Open the build or deploy log and read from the bottom up. A line ending in 'exit code 1' is a compile or build failure in your code — the same failure that would block a local build. A network or timeout message ('ETIMEDOUT', 'fetch failed', a 5xx from the build host) is a platform-side hiccup, and retrying the publish a minute later usually clears it. Treat these two cases differently: one needs a code fix, the other just needs a retry.

If the log shows a genuine build error, fix that one error rather than clicking publish again or re-prompting the AI to 'fix the deploy.' Repeated publish attempts on a build that cannot compile will keep failing identically and waste credits. Resolve the named file and line, confirm the editor preview still builds clean, then publish once.

Related: Decode a Lovable build that fails with exit code 1 · Browse all Lovable deployment errors

How do I force a hard redeploy from a clean commit?

A hard redeploy rebuilds from your latest source and replaces the live artifact instead of patching it. The goal is to make the serving layer throw away the stale build entirely. Do it from a known-good commit: confirm the editor preview is correct first, then trigger publish fresh rather than retrying a half-finished job that may be stuck on a bad state.

  1. Confirm the editor preview shows your intended changes — never redeploy a broken preview.
  2. Cancel any publish that is hung or spinning so it does not collide with the new job.
  3. If your project syncs to GitHub, confirm the latest commit hash on your branch matches what you expect to ship.
  4. Trigger Publish again from the editor — this starts a fresh build from current source.
  5. Watch the build log to completion; do not start a second publish while one is running.
  6. Once it reports success, open the live URL in an incognito window and verify the new commit is serving.
What NOT to do: do not spam the Publish button while a job is running, and do not re-prompt Lovable to 'rebuild everything' to force a deploy. Both create new in-flight builds that can race each other and leave the serving layer pinned to whichever finished last — often the old one.

How do I bust the CDN and browser cache so the new commit serves?

If the publish succeeded but the old commit still serves, the build shipped and the cache did not update. You need to invalidate two layers: the CDN cache on your host and the browser cache on the client. Purge the host cache first, then force-reload the client. On a custom domain this is the single most common reason a correct deploy still looks stale.

Static bundles are usually content-hashed, so a genuinely new build ships a new filename and dodges the cache automatically. When the old filename keeps loading after a successful publish, the host is serving a cached index.html that still references the old bundle. Purging the host cache forces it to serve the fresh index that points at the new hashed files — which is why the host purge has to come before the browser refresh.

  1. On your host (Vercel, Netlify, Cloudflare), open the deployment and purge or invalidate the CDN cache for the site.
  2. Hard-refresh the live page: Cmd+Shift+R on Mac or Ctrl+Shift+R on Windows to bypass the browser cache.
  3. If a service worker is registered, open DevTools then Application then Service Workers and click Unregister, then reload.
  4. Re-test in a fresh incognito window to confirm the new bundle filename loads.
  5. If you use Cloudflare in front of the host, purge its cache separately — it caches independently of the origin.

Related: Fix a Lovable custom domain stuck on an old build

Could a GitHub sync mismatch be deploying the wrong commit?

Yes — if your project deploys through GitHub, the host builds whatever commit your branch points at, not what the Lovable editor shows. A broken or rerouted sync means your editor edits never reached the branch the host builds from, so production faithfully ships an old commit. The deployed hash will not match your editor's latest, and that mismatch is the whole bug.

Check the commit hash on the deployment in your host's dashboard and compare it to the HEAD of the branch you expect to deploy. If they differ, the host built an older or different ref. The usual causes are a paused or disconnected Lovable to GitHub sync, a renamed repository or branch that broke the connection, or the host wired to the wrong branch. Production is not stale by accident — it is building exactly the commit it was told to.

Reconnect the sync, push the current source to the correct branch, and confirm the new commit hash appears on the host before you redeploy. Until the editor, the branch, and the deployed hash all agree, every publish will keep shipping the same old commit no matter how many times you retry.

Related: Repair a broken Lovable to GitHub sync · When a repo rename breaks Lovable sync

When is this a Lovable platform issue and not something I can fix?

If your preview is correct, the build log shows no error, the commit hashes match, and you have purged every cache but production still serves an old commit, the failure is in the platform's publish pipeline — not your project. Retry the publish a few times across a short window; transient platform incidents usually clear on their own. If it persists for more than an hour, escalate rather than burning credits.

Signs it is platform-side: the publish reports success but the live artifact never changes; the build log ends cleanly with no error yet nothing ships; or the same publish fails with 5xx or timeout errors regardless of your code. None of these are fixable by editing your app, and re-prompting the AI will only add changes you did not ask for while the real bottleneck sits in the deploy queue.

A senior engineer can confirm in minutes whether the deployed artifact actually matches your source, force a clean redeploy from a verified commit, and bypass the stale serving layer entirely — often by deploying to your own host so you are never again dependent on a single publish button. If real users are seeing an old version right now, that is the fastest path back to a correct production build.

Related: Get a stuck Lovable deploy fixed fast · Migrate your Lovable app to Vercel

Frequently asked questions

Lovable says it published but my live site still shows the old version — why?
The build shipped and the cache did not update. Your CDN or browser is still serving the previous bundle. Hard-refresh with Cmd+Shift+R or Ctrl+Shift+R, then purge the cache on your host and re-test in incognito. If the new commit appears in incognito but not your normal browser, it was only your local cache the whole time.
What does 'Oops! couldn't publish your site' mean in Lovable?
It means the publish job failed before producing a deployable build, so Lovable kept your previous version live. The real reason is in the build log: usually a TypeScript error (exit code 1), a failed dependency install, or a transient platform timeout. Read the log from the bottom up — a code error needs a fix, a timeout just needs a retry a minute later.
How do I force Lovable to redeploy and stop serving the old commit?
First confirm the editor preview is correct, then cancel any hung publish so jobs do not collide. Trigger Publish again to rebuild from current source, watch the build log to completion, and verify the result in an incognito window. If it still serves the old commit, purge your host's CDN cache before redeploying again.
Is the Stale-Commit Deploy a problem with my code?
Almost never. The Stale-Commit Deploy means your live URL is pinned to an older build while your source is correct in the editor. It is a publish or caching failure in the serving layer, not a bug in your app. Re-prompting Lovable to rebuild your code will not fix it and will burn credits on something that was never broken.
Why does my Lovable preview update but production never changes?
The editor preview reads your live files directly, while the published site reads a cached, compiled artifact. When the publish pipeline does not complete or the cache is not invalidated, the two drift apart. The preview keeps updating with every edit while production stays frozen on the last build that actually shipped to the serving layer.
How do I clear the cache so my new Lovable deploy shows up?
Purge two layers. On your host, invalidate the CDN cache for the deployment. Then hard-refresh the page (Cmd+Shift+R or Ctrl+Shift+R) and, if a service worker is registered, unregister it under DevTools then Application then Service Workers. If Cloudflare sits in front of your host, purge its cache separately. Purge the host first, then the browser.
Could my custom domain be the reason the old commit keeps serving?
Yes. A custom domain often sits behind its own CDN cache that updates independently of your lovable.app URL. If the lovable.app URL shows the new commit but the custom domain shows the old one, the domain's cache is stale or it points at the wrong host. Re-verify the domain target and purge that cache, not your app code.
I deployed through GitHub and it shipped the wrong commit — what happened?
Your host built whatever commit your branch points at, which is not always what the Lovable editor shows. A paused sync, a renamed repo, or the host wired to the wrong branch all leave production building an old ref. Compare the deployed commit hash to your branch HEAD; if they differ, fix the sync and push the current source before redeploying.
How do I know if this is a Lovable platform outage instead of my mistake?
If your preview is correct, the build log is clean, the commit hashes match, and you have purged every cache but production still serves an old commit, the failure is in the publish pipeline. Retry a few times across a short window — transient incidents clear on their own. If it persists past an hour with no log error, it is platform-side and worth escalating.
My publish keeps failing and real users see the old version — can someone fix it fast?
Yes. If your changes are correct but the publish keeps stalling and users are stuck on an old build, an engineer can confirm whether the deployed artifact matches your source, force a clean redeploy from a verified commit, and bypass the stale serving layer — often by moving you to your own host. Book an emergency fix and we triage the same day.

App down or leaking data? Get an expert on it within 24–48h.

Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.

Get emergency help