~/talk

Now and .then: Debugging Async JavaScript

Talkat Reactathon 2022 · 2022-05-03..05-05· [javascript, testing]
slides:none on file

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

  1. 0:00Introduction to async debugging
  2. 1:10Why async debugging is hard
  3. 2:16First async bug example
  4. 3:41Debugging with console.log
  5. 6:48Async code execution flow
  6. 8:13Categories of async bugs
  7. 8:34Silent promise errors
  8. 12:03Error handling pitfalls
  9. 12:45Debugging with Chrome DevTools
  10. 16:40Promise error handling quirks
  11. 17:23Async await conversion issues
  12. 19:09Async function return values
  13. 21:15Best debugging tool is experience
  14. 22:39Be the bad dog for learning
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.