Blog · 31 October 2026
Why your AI-built app works on your laptop but breaks when you deploy it
Your app works perfectly on your computer. You deploy it, and you get a blank page, an error, or a sign-in button that does nothing.
Almost always, the app is relying on something that only exists on your laptop. Coding agents test where they run, so these problems stay hidden until the app moves. Here are the usual causes, and the sentence to give your agent for each.
1. It still points to localhost
What you see: the page loads, but nothing happens when you click, or data never appears. It may even work on your computer and fail on your friend's.
Why: somewhere in the code is a link like http://localhost:8000/api. On your computer, that's your server. On anyone else's, it's nothing.
Tell your agent: "Find every hardcoded localhost address and make it work on the live link too."
2. The server only listens to your computer
What you see: the app never starts properly, or the host says it didn't respond.
Why: many servers start up listening on localhost by default, so they ignore outside visitors. They need to listen on 0.0.0.0 and on the port the host gives them, instead of a port written into the code.
Tell your agent: "Make the server listen on 0.0.0.0 and the port in the PORT setting."
3. Your secrets stayed behind
What you see: sign-in fails, payments fail, or the AI feature returns an error.
Why: your API keys live in a .env file, and that file should never travel with your app. The live app has to be given those values separately.
Tell your agent: "List the settings this app needs, and set them on the live app as secrets."
Don't solve this by pasting keys into your code. Anything in your frontend code can be read by anyone who opens the page.
4. Your data is in a file
What you see: the app works, then everything people saved disappears after an update or restart. Or it fails the moment it tries to save.
Why: SQLite databases and uploads saved next to your code are just files on your laptop. Live apps are often restarted and replaced, so those files can't be relied on. On Toupas, the app's folder is read-only, so this fails right away instead of losing data later.
Tell your agent: "Move saved data to a real database and uploads to file storage." More on this here.
5. The database address is your computer
What you see: "connection refused", or the app crashes as it starts.
Why: the code connects to a database on your own machine, which the live app can't reach.
Tell your agent: "Read the database address from the DATABASE_URL setting instead of the code."
6. Something it needs was only installed for development
What you see: "Cannot find module" or "command not found", only on the live app.
Why: live apps usually leave out packages listed as development-only. If your app needs one of them to run, it won't be there.
Tell your agent: "Move everything the app needs at runtime out of devDependencies."
7. Refreshing a page gives you a 404
What you see: clicking around works, but refreshing /about or opening that link directly shows "not found".
Why: in single-page apps, the browser handles those paths. The server only has index.html, and has to be told to send it for every path.
Tell your agent: "Set this app up as a single-page app on the host."
8. A file name has the wrong capitals
What you see: a missing image or a "module not found" error that makes no sense.
Why: Macs and Windows PCs usually treat Logo.png and logo.png as the same file. The Linux computers most hosts use don't.
Tell your agent: "Check that every import and file link matches the file name's exact capitals."
9. It runs out of memory
What you see: the app starts, then stops at random, often under load or while handling a big file.
Why: your laptop has many gigabytes of memory, and a small hosting plan may have a tiny fraction of that. Toupas's App plan starts at 128 MB, for example. Some apps fit easily; heavier frameworks or image processing may not.
Tell your agent: "The live app is running out of memory. Reduce what it uses, or tell me how much it needs."
How to find the cause fast
Don't guess: look at what the live app printed. Those logs usually name the problem.
If your app is on Toupas, your agent can read them itself. Toupas also recognises many of the failures above and tells the agent what to do, including causes 2, 4, 5, 6 and 9. Whichever host you use, paste the logs into your agent along with what you expected to happen. That one habit fixes most of these in a single try.
Questions
Why does my app work locally but not after I deploy it?
Usually because it relies on something only your laptop has: a localhost address, a .env file, a local database or a development package. The live app's logs normally name which one.
Why does my deployed app show a blank page?
Open your browser's developer tools and look for errors. A common cause is a link that still points to localhost, or a missing setting that the page needs to start.
Why did my saved data disappear after an update?
The app probably keeps data in files next to its code, such as a SQLite database. Live apps get replaced on update, so keep data in a separate database and uploads in file storage.
Why do I get a 404 when I refresh a page?
In a single-page app, the browser handles the paths. The host has to be set up to send index.html for every path.
Paste this into your coding agent
Make this app live with Toupas. Instructions: https://toupas.com/agents.md