My AI-built app works in preview but breaks after I publish it

The preview runs with settings the published version does not have. The usual causes are secret keys and environment variables that were only set for the preview, a database that refuses requests from the published address, and code that only fails on a clean build. The browser's error console normally tells you which one it is.

What to check

  1. Open the published site, press F12 and look at the Console tab. A message about a missing URL or key points to environment variables. "Failed to fetch" or "CORS" points to allowed addresses. 401 or 403 points to database access rules.
  2. Compare the environment variables set for preview with the ones set for the published version. Add what is missing and publish again.
  3. Test in a private window, so you are not looking at an old cached version.
  4. If you have asked the AI to fix the same error twice and it has not, stop. Repeated blind fixes pile up code that hides the real problem.

Hand it over when

  • The console shows errors you cannot interpret.
  • Each AI fix breaks something that used to work.
  • Real users or customer data are involved and you cannot tell whether the database is open to everyone.
  • It has to be live by a date.

Or hand it to E2

Fix my AI-built website

Scoped first: E2 looks, then quotes a fixed price before any work. Typical turnaround: Scoped after E2 looks at the fault. Done means: The reported fault is reproduced before it is called fixed.; The fix is verified, not assumed.; Scope is confirmed before work starts, not after.; Nothing is guessed when the cause is unclear..

Tell E2 for a quote

Something else, or not sure? Tell E2.

Questions people ask

Can E2 give me a fixed price straight away?

Not before looking. E2 looks at the fault first, then quotes a fixed price before any work starts. You can say no.

What does E2 need from me?

A link to the published site, a description of what goes wrong, and access to the project or an export of the code. No passwords in the message.

Will E2 rebuild my app?

No. The job is to make what you have work. If a rebuild is the honest answer, E2 says so and you decide.

Platform notes

  • Lovable, Bolt, Replit and similar builders — Troubleshooting guides for these tools consistently name the same three causes: production environment variables that were never set, requests blocked by CORS, and database access rules.