App Finishers

Fix guide · updated 2026-11-11

Lovable published site not working (but the preview works)

works in the preview · broken on the published site

Your app works in the Lovable preview. On the published address, something doesn't: login fails, a list is empty, an image is missing, a button does nothing. You ask Lovable to fix it, it checks the preview, finds nothing wrong, and says it's fine. The preview and the live site are the same app running in two different places. A short list of differences between those two places explains almost every case.

What's different between the preview and the live site

One thing is usually not different: the database. Lovable's docs say that "the preview and your published app share the same backend and data, so changes to your database affect both." The exceptions are payments (section 5) and older projects with separate Test and Live environments (section 4).

1. Find the real error on the live site

Open the published address in a private window, so nothing is left over from earlier visits. Right-click the page → Inspect, and look at two tabs:

That's also what to send Lovable. A screenshot shows what is broken, and these lines show why. For example:

On the published site https://yourapp.lovable.app (not the preview),
clicking "Save" does nothing.
Console: [paste the first red line]
Failing request: POST https://.../rest/v1/orders, status 401
Response: [paste it]
The same click works in the preview. Find why the published site
behaves differently. Don't change anything yet, explain first.

Then find your case below.

2. The live site is behind your preview

Publishing deploys a copy of your project as it was at that moment. Later changes stay in the preview until you click Publish, then Publish changes. A small dot on the Publish button means the live site is behind. See Lovable publish not working if the publish itself fails.

What makes this confusing is that, on most projects, the database doesn't wait for a publish. Rename a column or change a table while you build, and the change is live at once, while the published pages are still the old ones. The preview works with the new database. The live site's old pages ask for things that are gone, and sections come up empty or show errors. Publishing brings the pages back in line with the database.

The same goes for server code in newer apps. Lovable's docs say that in apps created from May 13, 2026, server functions and API routes "are part of the app, so changes to them go live when you publish." Until then only the preview runs the new version. A change of AI model works the same way: "Until you publish, only the preview uses it."

3. Sign-in works in the preview and fails on the live site

After a login, your users are sent back to your app, and only to addresses on an approved list called Redirect URLs. Lovable's docs name this as the usual cause: the published address or the custom domain is missing from that list.

4. Data shows in the preview and the live site is empty

The database is the same, so the data is there. What differs is who is asking for it. A browser keeps a separate sign-in for each address, so being signed in inside the preview doesn't sign you in on the live site. And your database's access rules (row-level security) decide which rows each person gets. For someone who isn't allowed, the database doesn't answer with an error. It answers with an empty list: status 200, [], nothing red in the console.

One exception: older projects that turned on Lovable's Test and Live environments, a beta that closed to new projects on March 24, 2026. There the preview and the live site have separate databases: rows you add while testing never appear on the live site, and changes to your tables reach the live database only when you publish.

5. Payments work in the preview and not on the live site

With Lovable's built-in payments, the preview runs in test mode and the published app in live mode. Each has its own products, prices and history. The docs are direct about it: "Checkout on your published app will not process real payments until you complete the go-live steps", which means your payment provider's verification, a readiness check, and a publish. It also works the other way: the preview only accepts test card numbers, so a real card fails there.

If you connected your own Stripe account instead, live mode has its own API keys, its own price IDs and its own webhook signing secret. A live site still using test values fails at checkout, or the payment goes through and your app never hears about it. See Stripe webhook 400 in a Supabase Edge Function.

6. An image or a file is missing on the live site

We tested this one on Vite, the tool that builds Lovable apps. An image whose address is typed as text and starts with /src/ loads on the development server and is missing from the built site:

<img src="/src/assets/hero.png" />

The build only keeps files that your code imports, or that sit in the public folder. In our test nothing red appeared in the console. In the Network tab, the image's line came back as a web page (text/html) instead of an image. Two ways to fix it:

// 1. import the file, and the build keeps it
import hero from "@/assets/hero.png";
<img src={hero} alt="" />

// 2. or move it to public/hero.png and use a path without /src
<img src="/hero.png" alt="" />

Ask Lovable to find every image, font or file referenced by a text path starting with /src/ and import it instead. It's the same cause each time.

7. A request is blocked on the live site only

The console shows a line like this one, from our test in Chrome:

Access to fetch at 'https://api.example.com/data' from origin 'https://yourapp.lovable.app' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://preview-address.example' that is not equal to the supplied origin.

Your own code only sees TypeError: Failed to fetch, which is why the button seems to do nothing. The server you're calling keeps a list of the sites allowed to call it from a browser, and that list has your preview's address, not your live one. It can be one of your own backend functions or an outside service. API keys limited to certain websites (maps, captchas, analytics) fail for the same reason. Add your live address, and your custom domain if you have one, everywhere the preview's address was entered: in the function's allowed origins, and in the outside service's dashboard.

If the line says No 'Access-Control-Allow-Origin' header is present instead, the function isn't answering browsers properly at all. See Edge Function returned a non-2xx status code.

8. The whole live site is down, blank, or asks visitors to log in

The first two are covered in Lovable publish not working.

Still stuck?

Do the same action in the preview and on the live site with the Network tab open in both, and compare the two lists of requests. The first request that differs, by its address, its status or its answer, is where the problem is. Write that down with the first red console line. It's what anyone helping you will ask for first.

Other Lovable app problems? See Fix a Lovable app.