Lovable or Bolt App Broken After GitHub Export? Fix (2026)
Your app works perfectly in the Lovable or Bolt preview. You connect GitHub, import the repo into Vercel, Netlify or another host, hit deploy, and get a failed build, a blank white page, a 404 on every refresh, or a sign-in button that bounces users back to localhost. Nothing in your code changed. So what broke?
When a Lovable app broken after export (or a Bolt app) fails on a new host, the code is almost never the problem. The builder’s preview quietly supplies things GitHub doesn’t carry: environment variables, a server runtime, routing rules, secrets and approved sign-in URLs. Once the code runs somewhere else, each of those has to be set up again. This guide shows you which one is missing and gives you the copy-paste fix. Just want the standard deploy steps? See how to deploy a Lovable app first, then come back here if something breaks.
Quick answer: An app that breaks after export to GitHub is usually missing one of six things on the new host: the right stack setup (Lovable projects created since May 13, 2026 use TanStack Start and need a server), Node 22 and a matching lockfile, the VITE_SUPABASE_* env vars at build time, a routing fallback, Supabase redirect URLs, or server secrets.
| What you see | Most likely cause | Check | Fix |
|---|---|---|---|
| Build fails on install | Lockfile and package manager mismatch, or wrong Node version | Build log: npm ci or bun install error | One lockfile, commit it, pin Node 22 |
| Build fails: nitro or output directory errors | TanStack Start project on an old build config | package.json for nitro and @lovable.dev/vite-tanstack-config | Update the config package, keep nitro installed |
| Blank white page | Missing VITE_SUPABASE_URL or key at build time | Browser console errors | Add env vars on the host, then redeploy |
| 404 when you refresh a page | Older Vite app with no index.html fallback | Open a nested URL directly | Add the SPA rewrite for your host |
| 404 or errors on server pages | TanStack Start app deployed as static files | Is the host running server code? | Deploy to a host that runs the server |
| Sign-in redirects to localhost or fails | New URL not in Supabase redirect allow list | Auth, URL Configuration | Set Site URL and redirect URLs |
| Payments, emails or API calls fail | Server secrets never left the builder | Server or function logs | Add secrets to the host or Supabase |
| Your fix disappears after the next prompt | Two-way sync overwrote it | GitHub commit history | Commit fixes to the synced branch |
Want it fixed for you? Launch Mango moves your Lovable, Bolt, v0 or Cursor app onto your own GitHub, Supabase and Vercel accounts, live at a real URL. Own Your App is $79 one-off, usually done in 1 to 2 days, with money back if it isn’t live on your accounts. Own and Secure ($199) also fixes sign-in and redirects, Supabase RLS, exposed keys and live Stripe payments. Not sure what’s broken? Run the free 2-minute app check.
Why Does a Lovable or Bolt App Break After Export to GitHub?
Because GitHub only receives your code. The builder’s preview also supplies environment variables, a server runtime, routing rules, stored secrets and an approved sign-in URL. A new host starts with none of those. Lovable’s own docs say that once the frontend runs outside Lovable, you take on its pipeline, environment variables, logs and availability.

Lovable’s guide to deploying and hosting outside Lovable is clear that Git sync and Download codebase both give you the application source, config files and database migration files, but not the records in your database or the files in storage. Secrets you added in the builder aren’t in the repo either. Here’s what travels and what doesn’t:
| Part of your app | In the GitHub repo? | Where you set it up again |
|---|---|---|
Code, package.json, config files | Yes | Nothing to do |
| Database schema, RLS policies | Yes, as files in supabase/migrations (Lovable) | Apply to your own Supabase project if you move it |
VITE_ Supabase URL and publishable key | Usually in .env (Lovable) | Host env vars, before the build |
| Server secrets (Stripe, email, API keys) | No | Host env vars or Supabase Edge Function secrets |
| Routing fallback for refresh | Only if you add it | vercel.json, _redirects or your web server |
| Sign-in redirect URLs | No | Supabase Auth, URL Configuration, and your OAuth provider |
| Database rows and storage files | No | Separate export and import |
Everything below is one row of that table going wrong. If you’re moving off the builder for good rather than just deploying a copy, our guide to migrating off Lovable or Bolt covers the database and data side in full.
Which Stack Is Your Lovable Project Built On?
Open package.json. If it lists @tanstack/react-start, your project is on TanStack Start, which Lovable made the default for new projects on May 13, 2026. It renders pages on a server, so the host must run server code. If it doesn’t, you have an older React + Vite app that builds to static files in dist.

This one fact decides most of the fixes in this guide, and lots of older tutorials assume the Vite stack. Lovable’s TanStack Start announcement lists the change: Vite + React Router became TanStack Start, static hosting became Cloudflare Workers, Edge Functions became TanStack server functions, and server secrets moved into Workers bindings. Lovable’s upgrade docs add that new Enterprise projects switched on June 22, 2026, and older projects can upgrade in place.
# Run in your cloned repo
grep -E '"@tanstack/react-start"|"nitro"|"@lovable.dev/vite-tanstack-config"|"react-router-dom"' package.json
| Stack | How to spot it | What you deploy | What the host needs |
|---|---|---|---|
| TanStack Start (Lovable, from May 13, 2026) | @tanstack/react-start in package.json | Server output plus static assets, built by Nitro | A host that runs server code: Vercel, Netlify, Cloudflare, a container or a Node server |
| Older React + Vite (Lovable before May 2026, Vite-based Bolt projects) | vite and usually react-router-dom | Static files in dist/ | Any static host, with an index.html fallback for routes |
Bolt projects vary by template, so run the same check. If you see vite without a server framework, treat it like the older Lovable stack below.
Why Does the Build Fail on Vercel, Netlify or Your Server?
Usually a lockfile or Node version mismatch, or an outdated build config. Hosts pick the package manager from your lockfile, so a stale or duplicate lockfile breaks installs. Lovable recommends Node 22, while Vercel now defaults to Node 26. TanStack Start projects also need the nitro package and a current @lovable.dev/vite-tanstack-config.

Start with the lockfile. Vercel’s package manager docs say it picks npm, pnpm, Yarn or Bun by looking at the lockfile in your repo. A Lovable project often ships a bun.lock, and Lovable’s docs warn that if you want npm ci, you need to run npm install locally and commit the generated package-lock.json first. Keep one lockfile, matching the install command your host runs:
# Option A: stay on npm (most hosts default to it)
rm -f bun.lock bun.lockb yarn.lock pnpm-lock.yaml
npm install
git add package.json package-lock.json
git commit -am "Use npm lockfile for deploys"
git push
Next, pin Node. Vercel’s Node.js versions page lists 26.x (the default for new projects), 24.x and 22.x, and lets engines in package.json override the project setting. Lovable’s deploy steps say to use Node.js 22. Netlify’s dependency docs read a .nvmrc, .node-version or NODE_VERSION variable:
// package.json (Vercel reads this)
{
"engines": {
"node": "22.x"
}
}
# .nvmrc in the repo root (Netlify reads this)
22
For TanStack Start projects, check two packages. Lovable’s docs say the build doesn’t package the app for a host unless nitro is in package.json, and Vercel’s Lovable integration page says zero-config detection needs @lovable.dev/vite-tanstack-config version 2.6.2 or higher:
npm install @lovable.dev/vite-tanstack-config@latest
npm ls nitro # must print a version; if it is empty, run: npm install nitro
npm run build # must pass locally before you push
Why Is the Page Blank After You Deploy?
A blank white page almost always means the app crashed on load, most often because the Supabase URL or publishable key was missing when the host built it. Vite bakes VITE_ variables into the bundle at build time, so adding them later does nothing until you redeploy. Open the browser console: the first red error names the cause.

Vite’s env docs say import.meta.env values are statically replaced at build time. Lovable’s docs repeat it for both stacks: browser values are embedded at build time, so rebuild after setting them. And Vercel’s environment variables docs say changes only apply to new deployments, never to ones already built. That’s why “I added the variable and it’s still blank” is so common.
Fix it in this order:
- Open the live URL, press F12 and read the Console tab. An error such as
supabaseUrl is required.(the current supabase-js wording) or an undefined key confirms missing env vars. - Add the variables in the host’s settings (next section has the full list), ticked for Production and Preview.
- Trigger a fresh deployment. On Vercel, redeploy from the Deployments tab; on Netlify, use Trigger deploy.
- Still blank on a TanStack Start app? Check that you deployed to a host that runs server code, not a static bucket. See Vite env variables not working for more prefix and build-time gotchas.
Which Environment Variables Does the Exported App Need?
For a Lovable app on Supabase, the browser needs VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY, and older apps also read VITE_SUPABASE_PROJECT_ID. TanStack Start apps need SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY for server code, plus every secret your server functions read. Secrets aren’t in the repo, so add them on the host by hand.

These names come straight from Lovable’s external deployment guide. You’ll find the public values in the repo’s .env file:
| Variable | Used by | Where to set it | Safe in the browser? |
|---|---|---|---|
VITE_SUPABASE_URL | Browser code, both stacks | Host env vars, before the build | Yes |
VITE_SUPABASE_PUBLISHABLE_KEY | Browser code, both stacks | Host env vars, before the build | Yes, RLS protects your data |
VITE_SUPABASE_PROJECT_ID | Browser code (older Vite apps) | Host env vars | Yes |
SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY | TanStack Start server code | Host env vars | Server only |
| Stripe, email and other API secrets | Server functions or Edge Functions | Host env vars, or Supabase Edge Function secrets | Never |
# Vercel CLI: add each value to production (repeat for preview)
vercel env add VITE_SUPABASE_URL production
vercel env add VITE_SUPABASE_PUBLISHABLE_KEY production
vercel env add SUPABASE_URL production
vercel env add SUPABASE_PUBLISHABLE_KEY production
vercel --prod
One warning while you’re in there. Vite’s docs say anything prefixed VITE_ ends up in client-side code. Never give a secret or service_role key a VITE_ name to “make it work”. If you find one, rotate it; our vibe-coded app security check shows where else keys hide. Bolt apps follow the same rules, but variable names depend on the code, so search for import.meta.env to list what yours reads.
Why Do Pages 404 When You Refresh?
On an older React + Vite app, the host looks for a real file at /dashboard, finds none and returns 404, because routing happens in the browser. Add a rewrite that serves index.html for every route. On a TanStack Start app, a 404 usually means the host isn’t running the server part, so fix the deployment instead.

Lovable’s verification checklist says exactly this: a 404 on a refreshed nested route means the host is missing the index.html fallback on older Vite apps, or isn’t running the server on TanStack Start apps. For a Vite app on Vercel, Vercel’s Vite docs give this vercel.json for the repo root:
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"rewrites": [
{ "source": "/(.*)", "destination": "/index.html" }
]
}
On Netlify, Netlify’s redirect docs use a public/_redirects file (Vite copies public/ into dist/):
/* /index.html 200
On your own server with nginx, the fallback from Lovable’s docs is:
location / {
try_files $uri $uri/ /index.html;
}
Don’t add these to a TanStack Start app. Lovable’s docs say the server handles routing there, and the try_files fallback is only for the older stack. Our Vercel 404 on refresh guide goes deeper on rewrites, clean URLs and trailing slashes.
Why Does Sign-In Break on the New URL?
Supabase only redirects users to URLs on its allow list. After export, your app lives at a new address, so magic links, password resets and Google sign-in either fall back to the old Site URL or fail. Set the Site URL to your new domain and add your preview and localhost URLs under Redirect URLs.

Supabase’s redirect URL docs say the Site URL is the default redirect when no redirectTo is given, and any redirectTo must be on the allow list in Authentication, URL Configuration. Wildcards cover preview deployments. Supabase’s own examples:
Site URL:
https://yourapp.com
Redirect URLs:
https://yourapp.com/**
http://localhost:3000/**
https://*-<team-or-account-slug>.vercel.app/**
https://**--<your-netlify-team>.netlify.app/**
Supabase recommends exact paths for production and wildcards only for local and preview URLs, so tighten the first line once things work. Then make sure your code sends users back to wherever the app is running, not a hardcoded preview link:
await supabase.auth.signInWithOAuth({
provider: 'google',
options: { redirectTo: `${window.location.origin}/auth/callback` },
})
Google sign-in has one more allow list in the Google Cloud console. Lovable’s docs also note that managed OAuth only applies while the backend runs on Lovable’s built-in backend. Our OAuth redirect to localhost fix walks through the Google side step by step.
Why Do Server Functions, Payments or Emails Fail After Export?
Because their secrets and runtime stayed behind. TanStack Start server functions run on your new host and read secrets you must add there. Supabase Edge Functions live in supabase/functions and need their own secrets plus a deploy. Lovable says connectors and built-in AI features keep running through Lovable until you replace them.

Lovable’s blog explains that on the TanStack Start stack, server-only secrets aren’t part of the deployed code at all; inside Lovable they’re injected as Cloudflare Workers bindings. Outside Lovable, add each one as a host env var without the VITE_ prefix. If your app uses Supabase Edge Functions, the Supabase CLI commands from Lovable’s guide are:
npx supabase login
npx supabase link --project-ref your-project-id
npx supabase secrets set STRIPE_SECRET_KEY=sk_live_...
npx supabase functions deploy
Want to run the app as a plain Node server, in Docker or on a platform Nitro doesn’t detect? Lovable’s docs give the Node server preset. The output listens on port 3000 unless you set PORT:
NITRO_PRESET=node-server npm run build
node .output/server/index.mjs
That works on any host that runs a long-lived Node process, such as Railway, as well as your own VPS. Netlify’s TanStack Start guide also says SSR, server routes and server functions deploy to Netlify Functions, and Vercel detects Lovable projects with zero config.
Is Two-Way Sync Undoing Your Fixes?
It can. Lovable syncs one branch both ways, by default main, and Bolt commits every working change and pulls GitHub updates every 30 seconds. Fixes made on a different branch, or that clash with the builder’s next edit, can vanish. Commit deploy fixes to the synced branch, or deploy production from a release branch you control.

Lovable’s GitHub integration docs say Lovable edits and syncs one branch at a time, and changes pushed to that branch sync back in. If both sides have new commits, the status shows “Lovable and GitHub have diverged” and Lovable pushes to a lovable-sync branch instead. Don’t delete the repo: that stops the sync, while renaming it keeps it running.
Bolt’s GitHub docs say it saves a commit for every change that doesn’t break the project and checks GitHub every 30 seconds. On a clash, you choose to pull and resend your last message, or pull and discard it. Bolt can’t merge branches in-app, so merge on GitHub. A safe pattern for both builders:
git checkout main && git pull
git add vercel.json .nvmrc package.json package-lock.json
git commit -m "Deploy config for Vercel"
git push origin main # the builder pulls this in
# optional: deploy production from a branch you merge into after review
git checkout -b release && git push -u origin release
Using Bolt’s Download button instead? Its project docs describe it as a zip file for working outside Bolt. A zip doesn’t sync, so connect GitHub for anything you plan to keep deploying.
Is Your Bolt App Still Using Bolt Database?
Maybe, and it matters. Bolt’s docs say new projects use a Bolt database by default, available on every plan. If your exported app uses it, your data lives in Bolt’s hosted database, not an account you own. To own the data, claim it in Supabase, which needs a Bolt Pro or Teams plan, then point your env vars there.

Bolt’s Supabase integration docs warn that connecting a Supabase database to a project that already has a Bolt database replaces the connection and may cause data loss, which is why claiming is the route that keeps your data. There’s also no supported flow for going back from Supabase to Bolt database. Once the data is in a Supabase project you control, the steps in the rest of this guide apply.
Lovable has a similar split: its built-in backend runs on Lovable’s side until you move it. If you migrate the database to your own project, check RLS straight away, because policies don’t always come across the way you expect. Our Supabase RLS not working and permission denied for table fixes cover the two errors that show up most often after a move.
How Do You Test an Exported App Before Going Live?
Clone the repo, install from the lockfile, add a .env.local with your Supabase values, and run a production build on your own machine. If it fails locally, it will fail on the host. Then deploy to a temporary URL and check five things: a refreshed nested page, sign-in, a write, an upload and a server function.

Lovable recommends a working local run before deploying anywhere, because it confirms the dependencies and env vars the app needs. GitHub’s ignoring files guide explains how to keep .env.local out of the repo:
git clone https://github.com/you/your-app.git && cd your-app
npm ci
cp .env .env.local # then edit values; keep .env.local out of git
npm run build
npm run preview # older Vite apps
node .output/server/index.mjs # TanStack Start with NITRO_PRESET=node-server
| Check on the temporary URL | Pass looks like | If it fails, see |
|---|---|---|
| Open /some/nested/page and refresh | Page loads, no 404 | Routing fallback or server runtime |
| Sign up, sign in, sign out | Lands back on the new domain | Supabase redirect URLs |
| Create and read a record | Saved and visible to that user only | Env vars, RLS |
| Upload a file | Upload works, file opens | Storage bucket and policies |
| Trigger a server function or payment | Responds without a 500 | Server secrets, Edge Function deploy |
| Console on the home page | No red errors | Env vars at build time |
Only then point your custom domain at the new host. Lovable’s docs note your lovable.app address keeps serving the last version you published there, and the Publish button only publishes to Lovable hosting. Our Lovable hosting alternatives guide compares where to put it, and the full checklist to launch your vibe-coded app covers what comes after it’s live.
Lovable or Bolt App Broken After Export FAQ

Why does my Lovable app work in preview but not on Vercel?
Because the preview runs on Lovable’s setup, with its env vars, server runtime and approved sign-in URLs. On Vercel, add VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY before the build, plus server secrets, then redeploy. Projects on TanStack Start need @lovable.dev/vite-tanstack-config 2.6.2 or higher for Vercel’s zero-config detection.
Do new Lovable projects still build to a static dist folder?
No. Since May 13, 2026, new Lovable projects use TanStack Start, which renders pages on a server and needs a host that runs server code. Older React + Vite projects still build static files to dist. Check package.json for @tanstack/react-start to see which one you have.
Should I delete bun.lock from my Lovable repo?
Only if you switch to npm. Hosts choose the package manager from the lockfile, so keep exactly one that matches your install command. Lovable’s docs say that to use npm ci, you run npm install locally and commit the generated package-lock.json. If you keep Bun, keep bun.lock instead.
Which Node version should an exported Lovable app use?
Node.js 22, per Lovable’s deployment docs. Vercel defaults new projects to Node 26 and also offers 24 and 22, so pin it with engines set to 22.x in package.json. On Netlify, add a .nvmrc file containing 22 or set a NODE_VERSION variable.
Why does sign-in send users to localhost after I deploy?
Because your Supabase Site URL or redirect URLs still point at localhost or the builder’s preview. In Supabase, open Authentication, URL Configuration, set the Site URL to your real domain and add your production, preview and localhost URLs to the redirect list. Then pass redirectTo from window.location.origin in your code.
Is Bolt Download the same as exporting to GitHub?
No. Bolt’s Download button gives you a zip file of the project to work on outside Bolt, with no sync. Connecting GitHub creates a private repo on a main branch that Bolt commits to on every working change and checks for outside updates every 30 seconds. Use GitHub for anything you deploy.
Want Your Exported App Live on Your Own Accounts?
Fixing one missing variable takes minutes. Getting the stack, lockfile, env vars, routing, redirects, secrets and database all right on accounts you own takes longer. If you’d rather hand it off, Launch Mango’s Own Your App plan moves it onto your own GitHub, Supabase and Vercel for a flat $79.

An export that breaks is the clearest sign of lock-in: the app only worked because the builder was holding pieces of it. The fix is owning all of it properly, with your code, database, hosting and secrets on accounts in your name.
That’s what we do at Launch Mango. Own Your App ($79 one-off) moves your Lovable, Bolt, v0 or Cursor app onto your own GitHub, Supabase and Vercel accounts, live at a real URL with a plain-English handover report, usually in 1 to 2 days. Own and Secure ($199 one-off) is everything in Own Your App plus sign-in and redirects checked and fixed, Supabase RLS policies and permissions locked down, exposed API keys removed from the frontend, live Stripe payments and webhooks, a security report and your custom domain included. Either way, money back if it isn’t live on your accounts.
Not sure what’s holding your app back? Run the free 2-minute app check. Five quick questions flag your lock-in, security and deploy risks and tell you whether Own Your App or Own and Secure fits.
Your app, on your accounts, safe for real users.
