---
title: "Why your app works on your laptop and nowhere else"
description: "Your app works in the preview and shows a blank page live. Here is why that happens, and the four things to check first."
url: https://www.fomio.ai/blog/why-your-app-works-on-your-laptop-and-nowhere-else
published: 2026-08-31T18:00:00.485+00:00
updated: 2026-08-31T18:00:00.485+00:00
topic: error-translation
words: 1726
---

# 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.

**In short:**

- Your code is almost certainly fine — what changed is where it is running.
- The preview version of your app already has your secret keys; the published version usually does not.
- A missing key shows up as a blank white page rather than an error message, which is why this wastes hours.
- The red text in your browser's console is usually enough for your AI tool to fix it in one go.
- You found out because a person told you — that is the part worth fixing permanently.

### 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]

> **The five-minute check** — Open wherever your tool keeps secrets while building and write down every name on the list. Then open the settings for the published version and compare. Anything on the first list and not the second is very likely your problem.

## 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]

- **~75** — messages spent by one Lovable user chasing a blank published page [^7]
- **3+** — hours lost before they gave up and asked for a refund [^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]

**Paste this into your AI tool**

```text
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.

1. **Your app is listening at the wrong door** — Replit'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]
2. **The old version is still deployed** — You 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]
3. **Your visitor's browser is holding a stale copy** — A 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](https://fomio.ai) 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?

1. Open your live address in a private browser window. Not the preview.
2. 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.
3. Compare your secret keys in the editor against the ones in the published settings. Add anything missing. Publish again.
4. 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


### Is my code broken if the preview works but the live site doesn't?

Usually not. The same code is running in both places. What differs is the surroundings: the preview has your database address, passwords and service keys already loaded, and the published machine starts empty. Replit's documentation says plainly that the editor and the published app are separate and settings do not carry across. So before you rewrite anything, compare the two sets of settings — that comparison solves this most of the time.

### Where do I find the red error text on my live site?

Open the real published address in your browser, press F12, and click the Console tab. Reload the page while it's open. Anything in red is the app telling you what went wrong. You don't need to interpret it — copy it exactly, including any file names and line numbers, and paste it into the AI tool you built the app with, saying it came from the live site rather than the preview. That one step is often the whole fix.

### Why does a missing key show nothing instead of an error?

Because an absent value comes back as nothing rather than as a complaint. Your app treats "nothing" as an answer and keeps going, then fails later, somewhere unrelated. A RapidDev guide describes exactly this pattern on Replit: the app tries to connect using empty settings, hits a fatal problem before drawing the first pixel, and the browser has nothing to display. Hence the white page instead of a message.

### The site works for me but not for my friend. Why?

Often one of you is holding an older saved copy of the page, which then goes looking for parts of a build that no longer exist. Try the address in a private or incognito window, and ask your friend to do the same. If it works there, it was a stale copy and not a real fault. Do this check before you change any code — it costs thirty seconds and saves a pointless rewrite.


## Sources

[^1]: Troubleshoot publishing — Replit Docs. https://docs.replit.com/cloud-services/deployments/troubleshooting
[^2]: How to store secrets safely in Replit — RapidDev (2026-03-27). https://www.rapidevelopers.com/replit-tutorial/how-to-securely-manage-project-secrets-in-replit-without-exposing-sensitive-data
[^3]: My Replit App Is Broken: The Actual Fix (2026 Guide) — Sonder (2026-07-14). https://www.sondersites.com/blog/fix-broken-replit-app
[^4]: Fix Blank Screen After Lovable Build — RapidDev (2026-03-25). https://www.rapidevelopers.com/lovable-issues/how-to-fix-blank-screen-appearing-after-lovable-app-build
[^5]: Fix Blank Output in Lovable Preview — RapidDev (2026-03-25). https://www.rapidevelopers.com/lovable-issues/how-to-fix-blank-output-after-building-a-lovable-project
[^6]: Lovable Preview Works but Live Breaks — Hire Lovable Xperts (2026-06-23). https://www.hirelovableexperts.com/deploy/lovable-deployment-errors
[^7]: Can see the site in Preview but... a published 'white site' — Lovable Feedback. https://feedback.lovable.dev/p/can-see-the-site-in-preview-but-wasted-greater3-hrs
[^8]: App works in Dev Mode, not in Deployed Mode — Replit Community Forum (2025-03-04). https://replit.discourse.group/t/app-works-in-dev-mode-not-in-deployed-mode/3978
