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.
| Symptom | Most Likely Cause | First Fix |
|---|---|---|
| 'Oops! couldn't publish your site' | Publish job failed — build error or platform hiccup | Re-run publish; check the build log for the failing step |
| Publish says success but live URL unchanged | CDN or browser cache still serving old bundle | Hard refresh, then purge the host cache and re-publish |
| Preview updated, production frozen | Stale-Commit Deploy — serving layer never swapped builds | Hard redeploy from a clean commit |
| Changes live for you, old for users | Browser cache on your machine only | Test in an incognito window before assuming a real stale deploy |
| Publish hangs and never completes | Build step stuck or platform queue backlog | Cancel, wait, then trigger a fresh publish |
| Custom domain old, lovable.app URL new | Domain pointed at a stale build or wrong host cache | Re-verify domain target and purge its cache |
| Old commit returns after a working deploy | GitHub sync mismatch — host built the wrong ref | Confirm 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.
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.
- Confirm the editor preview shows your intended changes — never redeploy a broken preview.
- Cancel any publish that is hung or spinning so it does not collide with the new job.
- If your project syncs to GitHub, confirm the latest commit hash on your branch matches what you expect to ship.
- Trigger Publish again from the editor — this starts a fresh build from current source.
- Watch the build log to completion; do not start a second publish while one is running.
- Once it reports success, open the live URL in an incognito window and verify the new commit is serving.
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.
- On your host (Vercel, Netlify, Cloudflare), open the deployment and purge or invalidate the CDN cache for the site.
- Hard-refresh the live page: Cmd+Shift+R on Mac or Ctrl+Shift+R on Windows to bypass the browser cache.
- If a service worker is registered, open DevTools then Application then Service Workers and click Unregister, then reload.
- Re-test in a fresh incognito window to confirm the new bundle filename loads.
- If you use Cloudflare in front of the host, purge its cache separately — it caches independently of the origin.
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?
What does 'Oops! couldn't publish your site' mean in Lovable?
How do I force Lovable to redeploy and stop serving the old commit?
Is the Stale-Commit Deploy a problem with my code?
Why does my Lovable preview update but production never changes?
How do I clear the cache so my new Lovable deploy shows up?
Could my custom domain be the reason the old commit keeps serving?
I deployed through GitHub and it shipped the wrong commit — what happened?
How do I know if this is a Lovable platform outage instead of my mistake?
My publish keeps failing and real users see the old version — can someone fix it fast?
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.