Why your app works on your laptop and nowhere else
The published version of your app is running on a different computer than the one you built it on — and that computer starts out knowing nothing.
ON THIS PAGE
Why does my app work in the preview but not when I publish it?
Because the preview and the published app run on two different computers. The preview already holds your database address, passwords and service keys. The published version starts with nothing but your code, so anything you set up while building has to be added again on the live side.
You built the thing. You watched it work. Buttons clicked, data saved, the login screen did the login thing. Then you sent the link to someone and they replied with a screenshot of a white page.
Here is the calming part. The code that worked ten minutes ago is still the code you have. Everything below is just the four or five ways the change of address shows up.
What is actually different between the preview and the live site?
When you build in Lovable, Replit, Bolt, v0 or Base44, you are working in a practice version of your app that the tool runs for you. It is stocked. It already has your passwords for other services and your database connection sitting there ready.
When you hit Publish, your app moves to a different machine that starts with nothing except your code. Replit's own troubleshooting docs are unusually blunt about this: the editor and the published app are separate, and things you set up in one do not travel to the other.1
So: two computers. One that knows everything, one that knows nothing. That is what "works on my machine" means, and it has been the oldest joke in software for about thirty years — which should tell you how normal this is.
What is the most likely cause?
The secret values didn't come with the app. Its database address, the password for it, the key for whatever handles payments or email. These are stored separately from your code on purpose, so they don't leak — and the published version very often doesn't have them.
Every source points the same way. A Replit-focused guide from RapidDev calls missing deployment secrets the single most common cause of deployment failures on that platform, because a key that isn't there comes back as nothing at all rather than as an error, so your app carries on until it walks off the cliff.2
A specialist Lovable deployment guide describes the same failure as the most common reason a perfect preview becomes a blank live site: a value that exists in the editor but was never added to the host the site actually lives on.6
Why do I get a white page instead of an error message?
Because your app builds its screen inside the browser, and if it hits a fatal problem before drawing anything, there is nothing to draw. You get a blank page, or a spinner that spins forever, and no clue as to why.
A real Lovable user described exactly this on the company's own feedback board: the preview looked fine, the published address was blank, and they spent a long stretch asking the AI to fix a white page before asking for the credits back.7
RapidDev's write-up of the blank-screen case lists what is usually underneath: an app trying to connect to a database with settings that are empty, or the browser asking for a piece of your app and getting a "not found" page back instead of the code it expected.4
Open your live site — the real address, not the preview — press F12, then click Console. You will see red text. You do not need to understand it. Copy it exactly and hand it to your AI tool. Both the Lovable and Replit guides recommend precisely that, because the error text is usually enough to get it fixed in one go.3
This is the error showing on my LIVE published site, not the preview. The preview works fine. Tell me what is causing it and exactly what to change. [paste the red text from the browser console here]
What are the other things that cause this?
Three more suspects, in rough order of likelihood. Each one has a short, boring fix.
- Your app is listening at the wrong doorReplit's docs note that a published app has to keep running as a proper web server and listen in the way the platform expects, rather than at an address it picked for itself.1 The Sonder guide describes the fix as searching your code for a port number written out as a plain number instead of read from the environment — one line.3
- The old version is still deployedYou make changes and they never actually reach the live site. Check your host's list of deployments and see whether the most recent successful one matches your most recent change. If it doesn't, trigger a fresh publish.6
- Your visitor's browser is holding a stale copyA saved older page can go looking for pieces of a build that no longer exists.4 If the site works for you and not for a friend, or the other way round, try it in a private window before you change a single line.
How do I find out next time before a customer does?
Notice what actually happened in every case above. The app broke, and you found out because a person told you. Sometimes a friend, sometimes a paying customer, sometimes much later, from the silence.
You cannot sit on your own site refreshing it, and the preview will keep telling you everything is fine — because on the preview it genuinely is. Something has to look at the live address from outside, on a schedule, the way a stranger would.
That is the gap Fomio was built for. You paste the link to your live app and it checks that address from outside. It reports one of three things: Working, Having trouble, or Down. There is nothing to set up beyond the link, and when something goes wrong it emails you and explains in plain language what likely went wrong.
The free plan watches one app, checks every five minutes, keeps a week of event history, and does not ask for a card. The Builder plan watches three, checks every minute, keeps a month of history, and writes the prompt for you to paste straight into the tool you built with — which, given that pasting the exact error into the AI is the fix in most cases above, is the part that saves the afternoon. Pro watches fifteen, keeps a year of history, and adds a public status page you can point users at. Current prices are on fomio.ai/pricing.
Two honest limits. It watches from outside — the same view a visitor has — so if the page loads but a button quietly fails, it will not always catch that. And it will not add the missing key for you. Being told happens by email, and that is the only way it tells you today.
What should I do right now?
- Open your live address in a private browser window. Not the preview.
- If it's blank, press F12, open Console, copy the red text, and paste it into your AI tool saying it came from the live site.
- Compare your secret keys in the editor against the ones in the published settings. Add anything missing. Publish again.
- Set up something that checks the live address for you, so next time you hear it from a machine and not from a customer.
Your app is fine. It's just standing in a room where nobody told it where anything is.
Questions people also ask
WHERE THIS COMES FROM
- Troubleshoot publishing — Replit Docs
- How to store secrets safely in Replit — RapidDev, 27 March 2026
- My Replit App Is Broken: The Actual Fix (2026 Guide) — Sonder, 14 July 2026
- Fix Blank Screen After Lovable Build — RapidDev, 25 March 2026
- Fix Blank Output in Lovable Preview — RapidDev, 25 March 2026
- Lovable Preview Works but Live Breaks — Hire Lovable Xperts, 23 June 2026
- Can see the site in Preview but... a published 'white site' — Lovable Feedback
- App works in Dev Mode, not in Deployed Mode — Replit Community Forum, 4 March 2025
