Why does my Node.js app crash with an unhandled promise rejection?
Because you did not handle the rejection. Always use try/catch with async/await, or .catch with promises. In newer Node.js versions, unhandled rejections crash the process, so add a global unhandled rejection handler as a safety net.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Common Async Mistakes in Node.js That Cause Bugs
You get a pending promise instead of the result. The next code runs before the operation completes, causing subtle bugs. Always await async calls when you need the result, or the code after it runs prematurely.
Because sequential await runs operations one after another, while Promise.all runs them in parallel. For multiple independent I/O-bound operations, Promise.all is often much faster since the operations run concurrently.
When multiple async operations modify shared state and interleave in unexpected ways. Be careful with shared state across async operations, and use proper sequencing where order matters, or use immutable patterns.
Still have questions?
Browse all our FAQs or reach out to our support team
