Now and .then: Debugging Async JavaScript
summary
Shows concrete async bugs and fixes: callback getConfig returns undefined because fs.readFile is async; a promisified getConfig silently swallows ENOENT because the promise never rejects; promise chaining runs unexpected .then after a .catch until the catch is moved to the end; converting parallel promises to await accidentally serializes them; forgetting to await yields a Promise instead of data. Uses console.log for quick checks and Chrome DevTools debugger to step through. Follow rule: always reject promises and practice failing cases.
AI-written summary · about
chapters (14)
- 0:00Introduction to async debugging
- 1:10Why async debugging is hard
- 2:16First async bug example
- 3:41Debugging with console.log
- 6:48Async code execution flow
- 8:13Categories of async bugs
- 8:34Silent promise errors
- 12:03Error handling pitfalls
- 12:45Debugging with Chrome DevTools
- 16:40Promise error handling quirks
- 17:23Async await conversion issues
- 19:09Async function return values
- 21:15Best debugging tool is experience
- 22:39Be the bad dog for learning








