Debugging starts with reproducing the problem and reading the complete error message and stack trace.
- Use logs for important application state.
- Use the Node inspector with a supported IDE.
- Reduce complex failures to smaller test cases.
- Never log passwords or tokens.
Deep dive
Read stack traces from the bottom up carefully
A stack trace shows where an error occurred and how execution reached that point. Focus on the first application-level location you control, then inspect the values and assumptions around it.
ADVERTISEMENT