How do I find a forgotten await in Node.js?
If you see a Promise object where you expect a value, you forgot await. The function returned a promise instead of the resolved value. Always await async calls when you need the result, or the next code runs prematurely.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Debug Async Code in Node.js Effectively
Log at boundaries (start and end of async operations), use node inspect for breakpoints, check for forgotten await, trace event loop order with labeled logs, check error handling for unhandled rejections, and use --unhandled-rejections=strict to catch missed handling early.
Because logging at the start and end of async operations shows where time goes and whether callbacks fire in the expected order. This is more useful than logging every line, and it reveals timing bugs without cluttering the output.
Use console.log with clear labels to trace the order of sync code, microtasks, and macrotasks. This reveals timing bugs where code runs in an unexpected order, which is the most common async bug type.
Still have questions?
Browse all our FAQs or reach out to our support team
