Debugging With AI
Errors are just information. Step through a live example of handing a stack trace to AI and landing on a real fix.
Intermediate12 min read
An error message is not a dead end, it is information. Step through how a real bug gets diagnosed and fixed with AI in the loop.
1. Hit the error
TypeError: Cannot read properties of undefined
at handleSubmit (Form.jsx:24:19)
Questions to ask when debugging
A good bug report to an AI looks a lot like a good bug report to a human. Answer these before you hit send.
- →What's the exact error and full stack trace, if there is one?
- →What did you expect to happen vs. what actually happened?
- →What changed recently, or what input triggers it?
- →Can you share the smallest piece of code that reproduces it?
Key takeaways
- An error message is data. Paste the whole thing, not your summary of it.
- Give the AI the trigger, the expectation, and the actual result — the same three things a bug report needs.
- “It says it is fixed” is not the same as fixed. Reproduce the original failure and confirm it is gone.
- If two fixes in a row miss, the model is missing context, not competence.