Error code

Node.js ERR_UNHANDLED_REJECTION

NODE.JSERR_UNHANDLED_REJECTION
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

A Promise was rejected but no rejection handler was attached.

How to fix it

  1. Add .catch() to the rejected Promise chain.
  2. Wrap await calls in try/catch blocks.
  3. Use the process unhandledRejection event as a last-resort logger.
  4. Enable --unhandled-rejections=throw to make Node.js exit on unhandled rejections.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.