Iterating and Fixing: When Things Go Wrong
- Identify the four types of problems that occur in vibe-coded apps
- Write effective bug prompts that describe symptoms with context
- Use the browser console to get precise error information
- Decide when to keep debugging versus revert to an earlier version
Something Went Wrong -- Now What?
At some point, your app will break. A feature stops working, the layout goes sideways, or something that worked perfectly yesterday doesn't anymore. This is not a sign you're doing it wrong -- it's a normal part of the vibe coding process. The builders who ship are the ones who know how to recover.
Problems in vibe-coded apps usually fall into one of four categories:
- Visual bugs: Something looks wrong -- wrong color, misaligned layout, text overlapping
- Functional bugs: Something doesn't work -- a button does nothing, a form won't submit, data isn't saving
- Regressions: Something that used to work broke after a recent change
- Total breakdown: The app crashes, shows a blank page, or throws an error on load
Each of these is fixable. The first rule: don't panic and don't immediately start over. Most problems are one or two prompts away from being resolved.
Describe the Symptom, Not Your Guess at the Fix
The most effective bug report gives the AI a clear picture of what's happening, not what you think the solution is. You might be wrong about the cause -- and if you are, sending the AI chasing the wrong fix makes things worse.
The formula for a good bug prompt: what you see + what you expected + what you last changed.
Weak: Fix the search button, it's broken.
Strong: When I click the search button, nothing happens. I expected the habit list to filter down to matching results. This stopped working after I asked you to update the card layout in my last message.
The strong version gives the AI three pieces of information: the symptom, the expected behavior, and when it started. That context dramatically narrows where the problem could be.
When the AI Goes in Circles
Sometimes you'll send the same type of fix request three, four, five times and the problem persists -- or gets worse. This usually means one of two things: the AI is misunderstanding what's broken, or the underlying issue is in a part of the code the AI isn't looking at.
When this happens, try a different approach before sending another fix attempt:
- Copy the error message directly. If your browser's developer console (right-click the page → Inspect → Console tab) shows a red error, paste it into the chat verbatim. Error messages are the most precise bug description possible.
- Ask the AI to explain before it fixes. Try: "Before fixing anything, explain what the search feature is currently doing and why you think it's failing." Reading the AI's diagnosis often reveals a misunderstanding you can correct.
- Narrow the scope. Instead of "fix the search," try: "Just focus on why clicking the button doesn't trigger any visible change. Ignore everything else."
The Revert Option
Lovable saves your project history automatically. If you've gone several messages deep on a broken path and want to start fresh from a point where things were working, you can revert to an earlier version.
Look for a version history or restore option in the Lovable interface. Rolling back a few steps is almost always better than starting your entire project over from scratch -- you keep everything that was working and only lose the broken changes.
A good habit: before making any major change (restructuring the layout, switching the database approach, adding authentication), make a mental note of what version you're on. If the change goes sideways, you know exactly where to revert to.
Knowing When to Push Forward vs. Start Over
There's one situation where starting over is genuinely the right call: when the foundation is broken, not just a feature. If the core data model is wrong, if auth is fundamentally tangled, or if the AI built something structurally different from what you needed -- patching it will cost more time than rebuilding with a better opening prompt.
A clean rebuild with the lessons from your first attempt is not failure. It's iteration. Your second prompt will be dramatically better than your first, and your second app will be dramatically better than your first too.
In the next lesson, you'll learn how to add new features confidently -- and how to protect everything that's already working while you do it.
- Describe what you see and what you expected -- not your guess at what the fix should be
- Paste browser console errors verbatim into the chat for the most precise bug reports
- Lovable's version history lets you roll back without losing everything
- Most bugs are one or two well-scoped prompts away from being resolved