Repository navigation
fix(ext/node): attach addAbortListener to EventEmitter, fix errorMonitor - #34262
Merged
Merged
Conversation
littledivy
pushed a commit
to crowlKats/deno
that referenced
this pull request
Jun 10, 2026
…tor (denoland#34262) `require("node:events").addAbortListener` was `undefined`, so libraries that hit the CJS path (notably undici 8.x used by `npm:undici`) crashed with `addAbortListenerNative is not a function`. Node attaches every named export as a static property on the `EventEmitter` constructor, and that's also what the ESM default export points at; Deno did this for most properties but had never assigned `EventEmitter.addAbortListener`, so both the CJS export and `import events from "node:events"` were missing it. The same file also captured the local `errorMonitor` binding before `EventEmitter.errorMonitor = kErrorMonitor` ran, so the named export and the namespace import resolved to `undefined` even though the property on the constructor itself was correct. Both bindings now read from `kErrorMonitor` directly. Fixes denoland#34261
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
require("node:events").addAbortListenerwasundefined, so librariesthat hit the CJS path (notably undici 8.x used by
npm:undici) crashedwith
addAbortListenerNative is not a function. Node attaches everynamed export as a static property on the
EventEmitterconstructor, andthat's also what the ESM default export points at; Deno did this for
most properties but had never assigned
EventEmitter.addAbortListener,so both the CJS export and
import events from "node:events"weremissing it.
The same file also captured the local
errorMonitorbinding beforeEventEmitter.errorMonitor = kErrorMonitorran, so the named export andthe namespace import resolved to
undefinedeven though the propertyon the constructor itself was correct. Both bindings now read from
kErrorMonitordirectly.Fixes #34261