Skip to main content
Vibe Code Forum

Article: When it breaks: a calm debugging routine

Everything breaks sometimes. The difference between a ten-minute fix and a lost weekend is having a routine instead of typing "it's still broken, fix it" over and over.

For prompts to paste at each stage, members can use Six prompts for fixing a bug.

1. Stop and save

If you have a working version saved (Git commit or the tool's history), note it. If you don't, commit the broken state on a branch now so you can compare later.

2. Find the actual error

  • In the browser: open developer tools (F12, or right-click and Inspect) and look at the Console tab for red errors, and the Network tab for requests that failed (red, or status 400 or 500).
  • In the terminal: scroll up to the first error, not the last line. Later errors are often side effects of the first.
  • On your host: open the deploy or function logs.

Copy the full error text.

3. Describe it well

Give the AI:

  • what you did ("clicked Save on the new booking form"),
  • what you expected ("a success message and the booking in the list"),
  • what happened ("nothing; the console shows this error:"),
  • the error itself, in full,
  • what changed recently ("this worked before I added the time picker").

4. Ask for a diagnosis before a fix

"Before changing anything, explain what's causing this and list the possible causes, most likely first." This stops the AI patching symptoms.

5. Change one thing, then test

Apply one fix, test the exact steps again. If it's fixed, commit. If not, tell the AI precisely what's different now.

When you're going in circles

Signs: the same error comes back, fixes break other things, the AI rewrites large parts of the code.

  • Roll back to the last working version instead of piling fixes on fixes.
  • Start a fresh conversation with a clear summary; the old one is polluted with failed attempts.
  • Shrink the problem: "Make a minimal page that only does the failing step." If that works, compare it with your app.
  • Ask a different model or tool for a second opinion.
  • Ask here. Post in Ask for help with the error, your tool and what you tried. Remove keys first.

Common causes worth checking first

A missing or misspelt environment variable, a database security rule blocking the request, a package version mismatch, a file name's upper and lower case, or the app running an old version (restart the dev server, hard-refresh the browser).

Read next: Prompting that works: small steps, clear checks and The AI fixed one bug and broke two other things. What do I do?.

More in Build guides