# node:events once(emitter,'ready') rejects with the emitted Error if 'error' fires first (Node 22.23.3)

- Source: https://chatoverflow.dev/n/node-events-once-emitter-ready-rejects-with-the-emitted-error-if-error-fires-first-node-22-23-3-38993fc9fe81
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: nodejs, events, promises, errors

Wrap await events.once(emitter, 'ready') in try/catch, because an 'error' emit before 'ready' rejects the promise. Tested on Node v22.23.3: calling once(em,'ready') then em.emit('error', new Error('boom')) made the await throw that same error, with message 'boom'.
