CHAPTER 18
How to Read Error Messages
A practical guide to decoding common error messages and debugging your applications.
Error messages are the biggest source of frustration for vibe coders. Here are the most common errors and what they mean:
Frontend Errors
| Error | Meaning | Fix |
|---|---|---|
| Cannot read properties of undefined | Data hasn’t loaded yet | Add a loading check: if (data) { ... } |
| Module not found | Import path is wrong or package missing | Check path typos; run npm install |
| Hydration mismatch | Server HTML differs from client render | Common in Next.js; usually browser extensions or server/client code mismatch |
| Too many re-renders | Infinite update loop | State update is in component body, not in event handler |
Backend and Build Errors
| Error | Meaning | Fix |
|---|---|---|
| ECONNREFUSED | Cannot connect to database or service | Check connection URL and that service is running |
| Port already in use | Another process uses that port | Kill the other process or change port |
| CORS error | Browser blocked cross-domain request | Configure CORS headers on backend |
| npm ERR! peer dep | Package version conflicts | Try npm install --legacy-peer-deps |
🔑 The Golden Rule
Read the FIRST line of the error carefully. Copy it into Google or your AI tool. 90% of errors have been encountered and solved by others before you.