Blog · 7 min read
Your AI-built app won't deploy. Here's what to check.
By the Obra Insights team ·
You built something in Lovable, Bolt, Cursor, Replit, or v0. It works in the preview. Then you hit deploy and get a build error, a blank white screen, or a site that loads but can't log anyone in.
The good news: the code is rarely the problem. Most failed deploys of vibe-coded apps come down to a handful of configuration issues the AI tool hid from you while you were inside its sandbox. Here are the nine we see most often, in the order you should check them.
1. Read the actual build log first
Before changing anything, open the build or deploy log on your host (Vercel, Netlify, Cloudflare Pages, Render, or the AI tool's own publish screen) and scroll to the first red line. Not the last one. The last error is usually a side effect. The first one tells you what broke.
Copy that line, and only that line, into your AI assistant along with the file it points to. Pasting the whole log invites the assistant to "fix" five unrelated things at once.
2. Environment variables are missing in production
This is the number one cause. Your .env file lives on your machine or inside the AI tool. Your host has never seen it. Add every variable in your host's dashboard (Settings, then Environment Variables) and redeploy.
Two details catch people out:
- Client-side prefixes. Vite apps (most Lovable and Bolt exports) only expose variables that start with
VITE_. Next.js apps needNEXT_PUBLIC_. Without the prefix, the value isundefinedin the browser. - Build time, not run time. Vite and Next.js bake public variables into the bundle when the app builds. If you add a variable after deploying, you must rebuild, not just restart.
And never put a secret key (Stripe secret, Supabase service_role, OpenAI key) in a VITE_ or NEXT_PUBLIC_ variable. Anything with those prefixes is readable by anyone who opens your site.
3. Blank white screen after deploy
A white screen almost always means JavaScript crashed before it could render. Open the browser console (right-click, Inspect, Console). You'll typically see one of these:
Failed to load module scriptor 404s on/assets/*.js: your host is serving from the wrong folder. Set the output directory todist(Vite) or leave the Next.js default.supabaseUrl is requiredor similar: a missing environment variable (see #2).- A wrong
basepath invite.configif you deploy to a subfolder.
4. Refreshing any page gives a 404
Single-page apps handle routing in the browser. When you refresh /dashboard, the host looks for a real file called dashboard, doesn't find one, and returns 404. Add a rewrite so every unknown path serves index.html:
- Netlify / Cloudflare Pages: a
_redirectsfile in your public folder containing/* /index.html 200. - Vercel: a
rewritesrule invercel.jsonthat sends/(.*)to/index.html.
5. Login works in preview but breaks in production
If you use Supabase Auth, go to Authentication, then URL Configuration. Set the Site URL to your live domain and add https://yourdomain.com/** to the Redirect URLs. If you use Google or GitHub sign-in, add the live domain to that provider's OAuth client too. Localhost and the preview URL don't cover production. This is behind most "login loop" and "redirects back to localhost" reports.
6. The build fails on type or lint errors
Preview environments are often forgiving. Production builds aren't. next build runs a type check, and a single any mismatch the AI introduced three prompts ago can block the whole deploy. Run npm run build locally to see the same errors. Fix the types rather than switching off checking; the errors usually point at a real bug.
7. Wrong Node version or a messy lockfile
If the log mentions an unsupported engine, a syntax error inside node_modules, or npm ci failing, pin the Node version your app was built with (an .nvmrc file or the host's Node setting) and make sure exactly one lockfile is committed. Having both package-lock.json and bun.lockb or pnpm-lock.yaml confuses most hosts.
8. File names that differ only by case
macOS and Windows don't care whether you import ./components/Header or ./components/header. Linux build servers do. If the log says a module can't be found but you can see the file, check the capitalization.
9. Payments and webhooks don't fire
Stripe checkout opens, the customer pays, and nothing happens in your app. Check that the webhook endpoint is registered for the right mode (test and live are separate), that you're using that endpoint's own signing secret, and that your handler verifies the signature against the raw request body. Grant access from the verified webhook, never from the success-page URL, or anyone can unlock your product by visiting that page.
When to stop prompting
If your assistant has "fixed" the same deploy error three times and it's still failing, stop. Every extra prompt adds changes you'll have to untangle later. Revert to the last commit that built cleanly, then work through the checklist above one item at a time.
And if you'd rather have someone look at it with fresh eyes, that's exactly what we do. If you already know the one thing that's broken, a $149 Quick Fix covers a single deploy issue, delivered as a pull request.