Repair guide

My Lovable app is broken after export — here's how to fix it

Updated June 2026 · 8 min read

It worked perfectly in the Lovable preview. Then you exported to GitHub, tried to run it yourself — or your free credits ran out — and now it's a wall of errors. This is the single most common patient that comes through our shop. Here's the triage, in the order that actually finds the problem.

1. It won't start at all: missing environment variables

Lovable's preview quietly injects your secrets — Supabase URL and keys, API keys for OpenAI or Stripe, auth configuration. None of those come with the export. If your terminal or deploy log shows errors like supabaseUrl is required, Invalid API key, or undefined is not an object the moment the app loads, this is almost certainly it.

The fix:

2. The build fails: TypeScript and dependency errors

Lovable's preview runs a dev server, which is forgiving. A production build (npm run build) is not. Two common failures:

3. It runs, but features silently don't work

This is the sneaky tier. The app renders, looks right, and half the buttons do nothing. The usual suspects, in order of likelihood:

4. Login broke the moment you moved it

Auth is its own category of pain — OAuth redirect URLs, site URLs, and email confirmation links are all bound to the domain the app runs on, and yours just changed. We wrote a separate deep-dive: why login doesn't work in your AI-generated app.

5. Decide: repair or rebuild?

Honest rule of thumb from the bench: if the app's data model is sound — sensible tables, real relationships — it's worth repairing, whatever the UI code looks like. If the database is a single table of JSON blobs and every feature is demo-ware, a rebuild on the same design is usually faster and cheaper than surgery. (Here's what either path actually costs.)

Bay door's open

Or skip the triage and bring it in

Sign in with GitHub, link the repo, and we'll read your actual code — not just your description — and send a fixed quote within 48 hours. Free analysis, no retainers.

Get your free analysis →