Skip to main content

How to Fix a Vibe Coded App That Broke

· By Natalie Walls

To fix a vibe coded app, first get back to a version that works, then describe the bug precisely and ask the AI for the cause before it changes more code. Most broken AI-built apps get worse because the fix attempts pile up on top of each other.

Here's a calm order to work in.

1. Stop and roll back

If the app worked an hour ago, go back to that version first. Every major platform keeps history:

  • Lovable saves every change. Its best practices suggest bookmarking a version after each working feature, and restoring or using "Revert and resend" when an experiment fails. Reverting restores code only, not database data.
  • Bolt has version history. Its troubleshooting guide says restoring uses no tokens, but it doesn't change your database or roll back server functions that are already deployed.
  • Replit Agent creates checkpoints. Replit's version control docs say a rollback can restore connected databases along with the code.
  • Claude Code has a /rewind menu that rolls code, the conversation or both back to an earlier prompt, per its best practices. Its checkpoints work alongside Git, not instead of it.

Notice the difference: on some platforms a rollback leaves your data alone. If a bad change wrote bad data, you'll need to clean that up separately.

2. Describe the symptom, not your guess

Say what you did, what you saw and what you expected. Paste the exact error text. Replit's Agent best practices ask for the error message, file names, what you were trying to do and what you already tried.

When I log in and open the dashboard, the page shows "Something went wrong". I expected to see my saved notes. This started after we added the tags feature. Console error: 401 Unauthorized on the notes request.

Screenshots help too. Bolt lets you select an element in the preview, tag a file with @ or attach an image.

3. Don't resend the same prompt

Bolt's guide makes a useful point: the AI can't always test its own output, so it may report a fix that changed nothing. Sending "still broken, fix it" again usually repeats the same mistake. Add new information each time, or change approach.

4. After two failed fixes, ask for the cause

Lovable recommends that if "Try to fix" fails after a couple of attempts, you stop, switch to Plan mode and ask for the root cause before any code changes. Claude Code's docs suggest something similar: after two failed corrections, clear the conversation and write one better prompt that includes what you learned.

Don't change any code yet. Review the changes made for the tags feature and explain what could cause a 401 on the notes request. Rank the likely causes.

A long, messy conversation can also confuse the AI. Bolt has a /clear command for this, and Claude Code has /clear too.

5. Add logging when you're stuck

If nobody can see what's happening, ask for visibility. Bolt's guide suggests asking the AI to add logging, reproducing the issue in a separate tab, and pasting the browser console output back into the chat. Lovable can read console logs directly, so a short, specific prompt is often enough there.

Common problems when you fix a vibe coded app

SymptomCommon causeWhat to check
Login works in preview but not on the live siteMissing redirect URLLovable's auth docs say this is usually a missing redirect URL for the published domain
Data saves but other users can't see it, or can see too muchDatabase access rulesYour row level security policies. See vibe coding with Supabase
Feature worked yesterday, broken todayA later change touched itAsk the AI to review recent changes to that feature, as Lovable suggests
Payment succeeds but the order isn't marked paidNo webhook, or an unverified oneSee how to add payments
Works on the platform, fails elsewhereMissing environment variablesYour host's settings. See how to deploy

6. Test the fix yourself

When the AI says it's fixed, check it. Refresh the page, try it logged out, try it on your phone, and try it with a second account if the bug involved user data. Claude Code's docs recommend asking for evidence, like the command it ran and the output, rather than a plain "it works".

7. Know when to start over

Sometimes a project gets too tangled. Lovable suggests remixing a project to start clean with what you've learned. If you keep your code in GitHub, starting a fresh branch from the last good commit does the same thing. Vibe coding with GitHub explains how to set that up before you need it.

And if your app handles money, health data or other people's private information, it's worth paying a developer to review it. Fixing a security hole after launch costs more than catching it before.

Prevent the next one

  • Change one thing per prompt and check it before moving on.
  • Bookmark or commit every working version.
  • Keep your prompts specific about scope.

Want a platform that's easier to debug? Self-fixing bugs is one of the criteria in our comparison.