veda.ng

Module 6: Debugging & Iteration

AI-generated code will break. Learning to read errors, iterate effectively, and use version control is the difference between a hobby project and a real product.

The Debugging Cycle

Error → Context → AI → Fix → Test → Loop

Step 1: Error Appears

Code breaks. Read the error message carefully.

Step 2: Copy Full Context

Copy the complete error text, not just the first line.

Step 3: Paste to AI

Include the error, relevant code, and what you expected.

Step 4: Apply Fix

Let AI explain the fix. Apply it. Run the code again.

Step 5: Test & Loop

Still broken? Loop again with the new error and more context.

Key rule: Never just say "it's not working." Always give the AI the exact error message, the relevant code, and what you expected to happen.

Every vibe coder will hit a wall where the AI generates code that doesn't work. This is not a failure, it's the normal development cycle. The skill that separates beginners from professionals is knowing how to debug effectively and iterate quickly.

Debug Decision Tree

How to diagnose issues and get effective AI help

Build errorFirst: Read the error message line numberThen: Paste exact error + surrounding code to AI
Runtime crashFirst: Check browser console for stack traceThen: Share component tree + state context with AI
Wrong outputFirst: Compare expected vs actual in detailThen: Describe the gap with specific examples
Performance issueFirst: Profile with React DevTools or LighthouseThen: Share metrics + component causing bottleneck