Works in preview but not when published
The preview and the published site are different environments. When something only breaks live, one of a short list of differences is to blame, and each has a quick check.

Key takeaways
- First rule out the simplest cause: the live site only changes when you republish, and restoring a version does not change it either.
- Then check what differs between the two addresses: sign-in redirect URLs, allowed origins, hard-coded URLs and build-time settings.
- Multiplayer room servers run in previews on every plan but publish only on paid plans with Multiplayer turned on.
When an app works in the preview but not on its published address, the simplest and most common cause is that the live site is running an older version: publishing takes a snapshot, and changes you made since only go live when you click Republish. If that is not it, the cause is something that differs between the two environments: a different address (which breaks sign-in redirects and allowed origins), a development-only setting, or a feature that publishes under different rules than it previews.
Why preview and published are not the same
The workspace preview is your app running live in your project's workspace, updating as the agent or you change code. The published site is a built, static snapshot hosted at your startbase.app address (or your custom domain), built when you publish. Different address, a production build instead of a running workspace, and a fixed moment in time. Almost every "only broken live" bug traces back to one of those three differences.
The causes, most likely first
1. The live site has not been republished
Keep editing freely: the live site only changes when you republish. Two traps catch people. First, restoring an earlier version from Versions affects your workspace only; the published site keeps running the version you published until you republish. Second, while a republish builds, the current version stays live, so checking too early shows the old one. How to check: the Publish panel shows progress through Queued, Building, Deploying and Live, and Deploy history lists every release. The fix: republish, wait for Live, then check again in a private window.
2. Sign-in redirects do not include the live address
Google sign-in, magic links and password resets only send users back to allowed addresses. If only the preview address is on the list, login works in preview and fails live. How to check: in the Backend tab, Users section, Sign-in settings, the URLs panel lists the Site URL and allowed redirect URLs. The fix: add the startbase.app address and any custom domain, exactly. More in login not working.
3. Hard-coded preview or localhost addresses
A link, image or API call pointing at the preview address, or at `localhost`, works in the workspace and fails for everyone else. How to check: the security check that runs when you open Publish flags localhost URLs that would break the live app. Search the code for the preview host too. The fix: use relative paths for your own pages and assets, and the real backend URL for API calls. The scan's Fix button sends each finding to the agent.
4. Something that only exists in development
Development setups often include conveniences that a static published site does not have. The classic example is a dev server proxy: in development, calls to `/api` are forwarded to another server, and in the published static build there is no proxy, so `/api` returns 404. Others: code wrapped in a development-only check, mock data used when a variable is missing, or a test account baked in. How to check: the Network tab on the live site shows the failing requests. The fix: call the real backend (an edge function URL, for example) directly, and remove development-only fallbacks that hide missing configuration.
5. Build-time settings
In Vite apps, variables starting with `VITE_` are embedded when the app is built. A value present while previewing but absent from the published build arrives as `undefined`, which can blank the whole page. If the live site is completely white, follow white screen after publishing, which covers reading the console error.
6. The live origin is not allowed by your server function
An edge function that allows requests only from specific origins will reject the published address if it was not added. The browser shows a CORS error. The fix: add every live origin, including `www` and non-`www` variants. See CORS errors explained.
7. Multiplayer room server rules
Games with a dedicated room server run a development copy of that server in the workspace preview and shared preview links on every plan. Publishing the game also publishes the server only on paid plans, and only once Multiplayer is turned on for the project. If the server cannot be published, the publish fails with a message saying what to fix, and your live site stays exactly as it was. How to check: the publish message, and your plan. The fix: turn Multiplayer on, upgrade if needed, and publish again. Details are in the multiplayer docs.
8. Runtime AI or the database paused
On workspaces using Cloud Credits, the balance pays for what published apps spend while they run: runtime AI, multiplayer and hosted databases. If it runs out, AI in your published apps pauses until you add funds, and hosted databases pause too, while building is unaffected. A per-app runtime cap set in Settings, under Usage, can also be reached. How to check: the Cloud Credits section shows the balance and the last 30 days of usage. The fix: add funds, turn on auto top-up, or raise the cap.
9. Production build quirks
Minification and stricter hosting expose bugs that development hides: file names whose letter case differs from the import, code that relies on running in a particular order, or a deep link that returns "not found" when the page is refreshed. How to check: the console and Network tab on the live page name the file or route. The fix: send the exact error to the agent, which can map minified names back to source.
A five-minute routine for any "only live" bug
- 01Confirm the latest release in Deploy history is Live and newer than your change.
- 02Open the live site in a private window (no cached files, no saved session).
- 03Open the console and Network tab, reproduce, and copy the first error and any failing request with its status code.
- 04Compare the failing request's address with what the preview calls.
- 05If real users are affected, roll back to the last good release from Deploy history while you fix it.
The message to send the agent
The booking form works in the preview but fails on the published site (https://book.example.com, Deploy history shows the latest release is Live). On the live site, the Network tab shows POST /api/bookings returning 404, and Google sign-in returns to the login page. Please: find any dev-only proxy, localhost or preview-host addresses and replace them with the real edge function URL, make sure the bookings function allows https://book.example.com and the startbase.app address, check the sign-in Site URL and redirect URLs include the custom domain, and run a production build to confirm before I republish.
For the full publish flow, history and rollback, see the publishing docs. To show work to teammates without publishing at all, the Share button gives a read-only link to the running preview.
Frequently asked questions
Do my changes go live automatically?
No. The published site changes only when you click Republish, so you decide when visitors see changes. Restoring a version also affects only your workspace until you republish.
Why does login work in preview but not on my live site?
The live address is probably missing from the allowed redirect URLs or the Site URL. Add every live address in Sign-in settings.
Why does my multiplayer game work in preview but fail to publish?
Previews run the room server on every plan. Publishing it needs a paid plan and Multiplayer turned on for the project; the publish message says which is missing.
How do I quickly undo a bad publish?
Click Rollback on the last good release in Deploy history. That version goes live again, and your workspace keeps your latest code.

