Your AI-built app works locally and breaks in production.

The app runs in the builder's preview or on your laptop, and fails once it is deployed or once other people start using it. That gap has a short list of usual causes. This page goes through them in the order worth checking, with tests you can run yourself.

Why the same code behaves differently once it is live

Your preview and your live site run the same code in different surroundings. The preview has its own settings, its own keys and often its own database. It also has exactly one user: you, already signed in, on a fast connection, looking at data you created. Production has none of that. When an app breaks after deployment, the cause is usually in those surroundings, and the code itself is often fine.

Surroundings can be checked without reading code. Start by writing down the exact failure: the page, what you did, what you expected, what happened, and whether it happens to every user or only to some. Then work down the table. The rows run roughly from the quickest cause to rule out to the slowest.

What breaks after deployment, and where to look

What you see live
A blank page or an error straight after deploying
Likely cause
A setting or key the app needs exists in the preview and was never added to the live environment
A check you can run
Compare the list of settings in both places, name by name
What you see live
Sign-in sends people to the wrong address, or loops
Likely cause
The allowed sign-in addresses still list the preview or localhost
A check you can run
Sign in on the live site in a private window and read the address bar at each step
What you see live
Data you created is missing on the live site
Likely cause
Preview and production use different databases, or changes to the tables were never applied to the live one
A check you can run
Find the database address each environment uses
What you see live
It works for you and is empty or forbidden for everyone else
Likely cause
Access rules or queries written around your own account
A check you can run
Repeat the journey in a brand new account
What you see live
Fine with one tester, wrong with several
Likely cause
Records overwritten or duplicated when two people act at once, or a usage limit reached on a connected service
A check you can run
Have two people do the same step at the same moment, then compare the records
What you see live
Payments, email or AI replies fail only when live
Likely cause
Test keys in production, or the outside service still calling the preview address
A check you can run
Open that service's own log of calls and read where each one went and what came back

Settings and keys that never made it to the live site

Most apps depend on a handful of values kept outside the code: the database address, keys for payments and email, the address of the site itself. Builders and laptops store these for you, which is why the preview works. The hosting service that runs your live site needs its own copy of each one, and it will not always warn you about a value that is missing. The app starts without it and fails at the first screen that needs it.

Make a two-column list: every setting the preview has, and the matching value on the live host. Look for gaps, for test keys where live keys belong, and for any value that still contains a preview or localhost address. While you are there, check that no private key sits in a setting the browser can read. A key that grants full access to your database or payment account belongs on the server side only.

The app has only ever been tested by one person

While you build, every record in the database is yours and every session is yours. Code written in that setting can assume there is only one user without anyone noticing. A dashboard fetches all orders, because all orders were yours. A page loads the first profile in the table, because the first profile was you. These hold until the second customer arrives, and then they show the wrong data or none.

The check is a second and a third account. Sign up on the live site with addresses you have never used there, go through the main journey in each, and compare what each account sees. Then have two people use the app at once and repeat a step that saves something, such as booking the same slot or editing the same record. Note anything that appears twice, disappears, or shows up under the wrong name.

Tracing one live failure to its cause

Payments, email and other services that call your app back

Some services do more than answer when your app asks. A payment provider tells your app that a charge succeeded. An email service reports that a message bounced. These calls arrive at an address you registered with the service, and during building that address is often the preview. After you deploy, the service keeps calling the old address, your live app never hears about the payment, and from the customer's side the purchase did nothing.

Each of these services keeps a log of the calls it tried to make and the answer it received. Open that log after a test purchase on the live site. A call sent to the wrong address, or one answered with an error, shows where the chain broke. Confirm as well that production uses the live keys for each service and that the test keys stayed with the preview.

What changes when real users arrive

Some faults need volume before they show. A page that loads every record in a table is quick with twenty rows and slow with twenty thousand. A starter plan on a database, email or AI service can run out partway through a busy day, and the app reports that as a generic error. A sign-in email that reached your own inbox may be filtered once many go out from a new sender.

You cannot rehearse all of this alone, so set the app up to show you its failures. Turn on error reporting, or at least learn where your host and database keep their logs, so that a customer's vague report can be matched to a specific error and time. Know the usage limits on each connected service and how you would find out that one was reached. Launch to a small group first and read the logs after they have used it.

What to fix yourself and when to bring someone in

Missing settings, wrong addresses and test keys are yours to fix, and the table at the top is usually enough to find them. Write down what you changed and retest in a new account each time. If the app works after that, you may not need anyone.

Bring someone in when the fault involves who can see whose data, when records are being lost or duplicated, or when you have fixed the settings and the live app still fails in a way you cannot reproduce on demand. Those problems live in the code and the database rules, and guessing at them with more prompts tends to add faults. Our Diagnostic is a fixed-price written plan of what is blocking the launch and what to build next, credited to the build if you continue with us. Whatever you decide, your repo and accounts stay yours.

Before you redeploy

Collect these first. With them, a report that the live app is broken becomes something a person can trace.

  1. The exact failing step, the time it happened and the account that hit it.
  2. A side-by-side list of the settings in the preview and on the live host.
  3. Which database each environment uses, and whether both have the same tables.
  4. The result of the main journey in a brand new account on the live site.
  5. The call log from each payment, email or AI service after one live test.
  6. The version deployed now, and how to put the previous one back.
How we can help

We can find what is breaking in production.

Book a free consultation and describe the failure. We will tell you whether it sounds like a settings problem you can fix yourself or something that needs the Diagnostic. If we take the work on, we trace the fault in your own accounts, repair it, and retest the live journey with separate users before handing it back.

Book a free consultation

On the project call, we’ll discuss the problem, your existing tools and what TDAT should take off your hands. Then we can define the scope and next steps.

Or call (919) 289-1231

Questions before we start

Why does my app work in the preview but not after I deploy it?

Usually because the live environment lacks something the preview had: a setting, a key, the right database or a sign-in address. The code is often the same in both places. Compare the two environments before you change any code.

It works for me but not for my users. What should I check first?

Sign up on the live site with a brand new account and repeat the journey. If the new account fails where yours succeeds, the app is probably relying on something specific to your account, most often access rules or data created while you were building.

Does this happen with Lovable, Bolt, Cursor and Replit alike?

In our experience, yes. The causes come from the gap between a building environment and a live one, so they turn up whichever tool wrote the code. The names of the settings differ between tools, and the checks on this page apply to all of them.

Should I rebuild the app with a developer instead?

A deployment failure alone is no reason to. Environment problems are usually small once found. A rebuild is a fair question when the data model or the access rules are wrong throughout, and that is something to decide after someone has read the code.

What does TDAT need to diagnose a production failure?

The live address, access to the code and to the hosting and database accounts, and one failure described step by step with the time it happened. We agree the access with you beforehand and limit it to what the diagnosis needs.