diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index d1fc6e8d3eb76b..a334cdea0b503b 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -207,6 +207,7 @@ function pipelineImpl(streams, callback, opts) { finishImpl(new AbortError()); } + kResistStopPropagation ??= require('internal/event_target').kResistStopPropagation; outerSignal?.addEventListener('abort', abort, { __proto__: null, [kResistStopPropagation]: true }); let error; diff --git a/lib/internal/watch_mode/files_watcher.js b/lib/internal/watch_mode/files_watcher.js index 34877c5aad59c3..a00ee9059523d8 100644 --- a/lib/internal/watch_mode/files_watcher.js +++ b/lib/internal/watch_mode/files_watcher.js @@ -45,7 +45,7 @@ class FilesWatcher extends EventEmitter { if (signal) { kResistStopPropagation ??= require('internal/event_target').kResistStopPropagation; const opts = { __proto__: null, once: true, [kResistStopPropagation]: true }; - signal?.addEventListener('abort', () => this.clear(), opts); + signal.addEventListener('abort', () => this.clear(), opts); } }