Web

My Vibe-Coded App Has Bugs. What Now?

Your Lovable, Bolt, Cursor or v0 app keeps breaking? Stop the prompt loop, write the bugs down, find the hidden security ones and decide what to fix first.

Hamza El Haissouf

6 min readUpdated EN

Key takeaways

  • When the same bug returns after two or three prompts, more prompting tends to move it around instead of removing it.
  • A bug written down with where, steps, expected and actual result is much faster to fix, whoever fixes it.
  • Supabase warns that a table in an exposed schema without row-level security is readable and writable by any role with a grant on it.
  • Anything in a VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variable can be read by anyone who opens the app.
  • Most AI-started apps have a usable structure: rebuilding the broken part is usually a better first move than starting over.

Short answer

Stop prompting for a moment and save the version you have. Write each bug down with the steps that cause it, then sort them: display bugs you can keep fixing with the AI tool, and logic, data, login, payment or deployment bugs that usually need someone to read the code. Check for the bugs you can't see too, such as open database tables and secret keys shipped to the browser. Then decide whether to fix, rebuild one part, or start over.

You built an app with Lovable, Bolt, Cursor, v0 or another AI tool, and the first version came together fast. Then the bugs started: a button that does nothing, a login that loops, data that disappears, a deploy that fails. Each new prompt fixes one thing and breaks another. This is where many AI-started apps stall, and most of them can be fixed. Here is the order I work in.

Why does each prompt break something else?

An AI coding tool edits several files for each request, based on what it can see at that moment. When the same bug comes back after two or three prompts, the tool is usually fixing a symptom in one place while the cause sits somewhere else, often in the login flow, the database rules or the way data is loaded. More prompts at that point tend to add code around the problem.

Before you change anything else:

  • Save a version that works, even partly. Use the tool's version history, or better, connect the project to GitHub and commit. You need a point you can go back to.
  • Stop adding features. Each feature built on a shaky base makes the bugs harder to find.
  • Note what changed just before each bug appeared, if you remember. It narrows the search a lot.

How do you write a bug down so it can be fixed?

"Payments don't work" can't be fixed by you, the AI tool or a developer. Write each bug in four parts:

  1. Where: the page or screen, and which kind of account (new user, admin, logged out).
  2. Steps: what you click or type, in order.
  3. Expected: what should happen.
  4. Actual: what happens instead, with a screenshot and the error message if there is one.

To find the error message in a web app, open the browser's developer tools (F12 in most browsers) and watch the Console tab while you reproduce the bug. The red lines are what a developer, or the AI tool, needs. Paste the exact text instead of describing it.

Which bugs can you fix yourself?

Sorting the bugs by kind tells you which ones you can keep working on alone.

Kind of bugWhat it looks likeWho usually fixes it
DisplayLayout broken on mobile, wrong text, a button out of placeYou, with the AI tool
LogicWrong totals, a filter returning the wrong results, a skipped stepYou if it is isolated, a developer if it keeps coming back
Data and loginUsers see each other's data, sign-up fails, records vanishA developer who reads the database rules and the login flow
PaymentsCheckout works once, subscriptions never activateA developer, tested in test mode before real money
DeploymentWorks locally, fails online, missing environment variablesA developer, once, with the setup written down

Display bugs are safe to keep prompting on. The last three kinds are where an app loses data, leaks data or takes money without delivering, so they need someone who reads the code instead of guessing from the screen.

Which bugs don't show on screen?

Some of the most serious problems never produce an error. Check these before real users arrive:

  • Open database tables. Many AI-built apps use Supabase, and its documentation is direct: a table in an exposed schema without row-level security (RLS) is readable and writable by any role with a grant on it. In the Supabase dashboard, check that RLS is on for every table, with policies that match who should see what.
  • Secret keys shipped to the browser. In a Vite app, a common setup for React apps built with these tools, any variable starting with VITE_ is bundled into the code the browser downloads. In Next.js the prefix is NEXT_PUBLIC_, in Expo EXPO_PUBLIC_. A Stripe secret key, an OpenAI key or a database service key in one of those is public. Stripe's publishable key (pk_...) is the one meant for the front end.
  • Pages that are only hidden. An admin page missing from the menu is still reachable by anyone who types its address. Access has to be checked on the server or in the database rules as well as in the interface.
  • Payment status trusted from the browser. If the app unlocks a paid plan because the browser reports a successful payment, that report can be faked. The reliable signal is the payment provider's webhook, received on your server.

If you find a secret key in the front end, move it to the server and then rotate it in the provider's dashboard. The old key has already been shipped to every visitor.

Is the code really yours?

Before anyone fixes anything, make sure you control the project:

  • The code in a GitHub repository you own. Most of these tools can sync to GitHub or export the project.
  • The database, hosting, domain and payment accounts in your name, or with you as owner.
  • A list of the services the app calls (email, SMS, maps, AI APIs) and where their keys are stored.

This matters even if you keep fixing the app yourself. It also makes a developer's review faster, because they can run the app instead of reading screenshots.

Should you fix, rebuild one part, or start over?

SituationUsual answer
A handful of display and logic bugs, a data model that makes senseFix them one by one, with a check for each
One tangled area (login, payments or database rules)Rebuild that part properly, keep the rest
A data model that no longer fits the productRedesign the database, then adapt the screens
Nobody can run or deploy the code, and it has no clear structureRebuild on a clean base, reusing screens and copy where possible

Starting over feels clean, but you lose working screens and weeks of decisions. Rebuilding only the broken area is usually the better trade. The way to know is to have someone run the code and read it, which is what an audit is for.

When should you bring in a developer?

Keep going on your own while the bugs are mostly display issues and each fix holds. Bring someone in when:

  • the same bug survives three attempts,
  • personal data or payments are involved,
  • you can't deploy, or the app only works on your machine,
  • the app has to go to the App Store or Google Play (see how to publish an Expo app),
  • you are about to show it to customers or investors.

Send them the repository, your bug list and the list of accounts. With those three things, the review starts from facts instead of guesses. If you want to know what finishing the app could cost first, read how the cost of finishing an app is worked out.

Checklist

  • A working version saved, the project connected to GitHub
  • Every bug written down: where, steps, expected, actual, error text
  • Bugs sorted: display, logic, data and login, payments, deployment
  • RLS on for every Supabase table, with real policies
  • No secret keys in VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variables
  • Admin pages and paid features protected on the server
  • Payments confirmed by webhook, not by the browser
  • Code, database, hosting and payment accounts in your name

Bugs you can't get rid of?

Send me what you started. I run the app, read the code and tell you plainly what is broken, what is unsafe and what it takes to get it live, before you commit to anything. See how I fix and finish apps started with AI tools, or send me your bug list on WhatsApp.

Sources

Official pages last read on .

Frequently asked questions

Why does the AI keep bringing the same bug back?

Each prompt edits several files based on what the tool sees at that moment. If the cause sits elsewhere, in the login flow or a database rule for example, the tool fixes the symptom and the cause produces it again somewhere else. Saving a working version and describing the bug precisely helps. Past two or three attempts, someone needs to read the code.

Is my Supabase data safe if the app works?

Not necessarily. Supabase's documentation warns that a table in an exposed schema without row-level security is readable and writable by any role with a grant on it. Check that RLS is enabled on every table and that the policies match who should see what.

Which keys can be in the front end?

Only keys designed to be public, such as Stripe's publishable key or Supabase's publishable key, which relies on row-level security. Anything in a VITE_, NEXT_PUBLIC_ or EXPO_PUBLIC_ variable is readable by users, so secret keys stay on a server.

Should I start over instead of fixing?

Rarely as a first step. If the data model fits the product, fixing the bugs and rebuilding only the tangled part is usually faster. A full rebuild makes sense when nobody can run or deploy the code and it has no clear structure. An audit tells you which case you are in.

Portrait of Hamza El Haissouf

Hamza El Haissouf

Full-stack developer for 6 years · Morocco

I build WhatsApp assistants and websites for private clinics and logistics companies. Remote, in English and French.

See my workAbout meLinkedIn

Related reading