Lovable, Bolt and v0 apps: the most common reasons they break in production
6 min read
On this page
- 1. Environment variables that did not travel
- 2. Auth redirect URLs still point to the preview
- 3. Row Level Security missing or too open
- 4. Secret keys in client-side code
- 5. Errors that nobody handles
- 6. No automated tests
- 7. Rate limits and free-tier ceilings
- 8. Webhooks that were never wired up
- 9. Database migrations out of sync
- 10. Duplicated generated code
- Where to start
Lovable, Bolt and v0 let people build a working app in an afternoon, and that is a real achievement. A prototype, though, runs in a forgiving setting: one user, test data, a preview URL and settings the tool configured for you. Production is different. Real users sign in from different devices, data must stay private, payments must be recorded once and only once, and the app has to keep running when something goes wrong. The issues below are the ones that come up again and again when an AI-built app makes that move.
None of this is a criticism of the tools. The same gaps appear in hand-written projects when nobody plans the step from demo to live product.
1. Environment variables that did not travel
Inside the builder, API URLs and keys are set up for you. When you export the code to GitHub and deploy it on Vercel, Netlify or another host, those values do not come with it. The app builds, but calls fail or the page is blank.
Two details catch many people:
- Prefixes. Vite projects only expose variables that start with
VITE_to browser code; Next.js usesNEXT_PUBLIC_. A variable without the right prefix is simplyundefinedin the browser. - Build time. Frontend variables are baked into the bundle when it is built. Changing a value in the hosting dashboard does nothing until you redeploy.
2. Auth redirect URLs still point to the preview
Email confirmation links, magic links, password reset links and social logins all send the user back to a URL after they sign in. If your Supabase Auth settings still list only the preview address or localhost, users on your real domain land on the wrong site or see an error.
Check the Site URL and the list of allowed redirect URLs in your auth provider, and the authorised redirect URIs in any OAuth app you created, such as Google or GitHub. Add your production domain and remove addresses you no longer use. This is one of the most common causes of the problems described on our Supabase auth or RLS broken page.
3. Row Level Security missing or too open
Many AI-built apps use Supabase, which gives the browser direct access to the database through an automatic API. That design is safe only when Row Level Security (RLS) is enabled on every table and the policies say exactly who can read and change which rows. Without RLS, anyone who opens the browser's developer tools can find the project URL and anon key and query your tables directly.
A common pattern in prototypes is a policy that allows everything, such as using (true), added to make an error go away. A safer policy ties rows to the signed-in user:
alter table public.profiles enable row level security;
create policy "Users can read their own profile"
on public.profiles for select
to authenticated
using ((select auth.uid()) = id);
Paste your schema and policies into the Supabase RLS Checker to find tables without RLS, policies that allow everyone, and update policies missing a with check clause.
4. Secret keys in client-side code
Anything that reaches the browser is public. If an OpenAI key, a Stripe secret key or the Supabase service role key sits in frontend code, anyone can copy it and use it on your account. Prompting the builder to "call the API" can produce exactly this if the request is not routed through a server function.
The fix has two parts: move the call into a server-side function (for example a Supabase Edge Function or an API route) that reads the key from a server environment variable, and rotate the key, because removing it from the code does not make it secret again. The Secret Leak Scanner runs in your browser and flags common key formats in pasted code or config.
5. Errors that nobody handles
Prototypes are usually built along the happy path: the network is fast, the API answers, the user types valid data. In production, requests time out, sessions expire and third-party services go down. Without error handling, the result is a blank screen or a spinner that never stops, and nobody knows it happened.
Look for:
- Data fetches with no error branch or retry
- No error boundary around major parts of the React tree
- Forms that fail silently when validation or a request fails
- No error tracking service to tell you when users hit a problem
6. No automated tests
Builders change code quickly, and each new prompt can touch files beyond the one you meant. Without tests, a fix in one place can break sign-up or checkout somewhere else, and you only find out from a user. A small set of end-to-end tests on the flows that make or lose money, such as sign-up, login and payment, gives a developer the confidence to change code without fear.
7. Rate limits and free-tier ceilings
Services that worked fine during testing can start refusing requests once real traffic arrives. AI APIs, email providers and maps services all apply rate limits, and free plans have lower ones. Supabase's built-in email sender is intended for development and is rate-limited, so production apps should connect their own SMTP provider. Your own endpoints may also need limits so one user or bot cannot run up your bill.
8. Webhooks that were never wired up
Payment and subscription apps rely on webhooks: the payment provider calls your server to say a payment succeeded or a subscription ended. Common gaps include:
- The webhook endpoint is not deployed, or points to a preview URL.
- The signing secret differs between test mode and live mode, and only the test one is set.
- The signature is not verified, so anyone could fake an event.
- The handler is not idempotent, so a retried event creates duplicate orders or credits.
If users pay but their account does not upgrade, check webhooks first.
9. Database migrations out of sync
During prototyping it is easy to change tables directly in the Supabase dashboard. Later, the repository's migration files no longer match the live database, or the development and production databases differ. Deploying to a fresh environment then fails, or a new feature expects a column that only exists in one place. The fix is to pull the current schema into migration files, agree that all future changes go through migrations, and apply them the same way everywhere.
10. Duplicated generated code
AI builders often solve a similar request by writing a new component or function rather than reusing an existing one. Over time you get three slightly different date formatters, two ways of fetching the current user, and a bug fixed in one copy but not the others. Files can also grow very large. This is not dangerous on its own, but it makes every later change slower and riskier. A developer taking over will often spend some early time consolidating duplicates before adding features.
Where to start
You do not have to fix everything at once. Start with the issues that can leak data or money, then the ones that block users, then the ones that slow future work.
- Environment variables set on the production host, with the right prefixes, and the app redeployed
- Auth Site URL and redirect URLs updated for the production domain
- RLS enabled on every table, with no allow-all policies left
- No secret keys in frontend code; any exposed key rotated
- Error handling and error tracking on main flows
- End-to-end tests for sign-up, login and payment
- Custom SMTP connected and rate limits reviewed
- Webhooks deployed, verified and idempotent, with live secrets set
- Migrations match the production database
- Obvious code duplication noted for clean-up
For a fuller pre-launch list, use the Production Readiness Checklist or read From vibe-coded prototype to production. If your app has stopped working and you are not sure why, our pages on a Lovable app not working and a Bolt app that is stuck walk through first checks. When it is time to bring in help, you can post your takeover for free and describe which of these issues you have already found.
Frequently asked questions
Are Lovable, Bolt and v0 bad tools for building real apps?
No. They are very good at turning an idea into a working prototype quickly. The problems in this guide come from the gap between a prototype and a production system, and they appear in hand-written apps too when nobody plans for them.
My app works in the preview but not on my own domain. What is the most likely cause?
Usually missing environment variables on the new host, or auth redirect URLs that still point to the preview address. Check both before looking for deeper bugs.
Is the Supabase anon key a secret?
The anon key is designed to be used in the browser, so it is not secret on its own. It is only safe when Row Level Security is enabled with correct policies on every table that holds data. The service role key is different and must never appear in frontend code.
Can I fix these issues by prompting the AI builder again?
Some of them, yes, especially small and well-described bugs. Issues that span configuration outside the code, such as auth settings, webhook endpoints and database policies, usually need someone to check the dashboards and test the whole flow by hand.
How do I know if my app has an exposed secret key?
Search your code and built files for key patterns, or paste them into a local scanner. Any key that has ever been in frontend code or a public repository should be treated as exposed and rotated, even after you remove it.
Stuck with a half-built app?
Post your project free. Developers who finish and rescue projects can send you an interest note, and you decide who to talk to. You agree scope and payment directly with them.
Free tools that help
Related guides
From vibe-coded prototype to production: the 25-point checklist
Your AI-built prototype works in the demo. These 25 checks, grouped into ten areas, cover what usually needs attention before real users and real money arrive.
ReadHow to give a developer access without sharing passwords
Use team invites and limited roles instead of shared passwords, service by service, and know exactly how to remove access and rotate keys when the work ends.
ReadHow to evaluate developers who want to finish your app
A practical way to compare developers and agencies who reply to your takeover: what to read, what to ask, how to test the fit with a small paid task, and which warning signs to act on.
ReadRelated problems
Lovable app not working? How to find what broke and get it fixed
Most Lovable apps that break do so for a short list of reasons: auth settings, database policies, keys, deploys, edge functions or payments. Here is how to narrow it down.
ReadBolt app stuck? How to get your project moving again
A stuck Bolt project usually means the AI has lost track of a large codebase, the build is broken, or the app only works inside the browser preview.
ReadSupabase auth or RLS broken? How to find the cause
Supabase auth and RLS problems show up as login loops, missing emails, empty pages or data leaks. Most come from a handful of settings and policy patterns.
ReadSecurity issues in AI-generated apps: what to check and how to fix them
AI app builders ship working features fast, but often leave keys in the browser, tables open and API routes unprotected. Here is how to check yours.
Read