-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Open
nodejs/undici
#4357Description
Version
22.5 through 22.17
Platform
Darwin 24.5.0 Darwin Kernel Version 24.5.0
Subsystem
No response
What steps will reproduce the bug?
import 'node:http';
import undici from 'undici';
console.log(undici.getGlobalDispatcher().request) // undefined
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Undici's globalDispatcher (from its superclass Dispatcher) should have methods request
, stream
, pipeline
, upgrade
, connect
What do you see instead?
globalDispatcher Agent is lacking all of those methods
Additional information
- external undici version does not affect the issue
- starting from node 22.5.0, the http module requires internal undici 6.x: a1869fa
- the issue does not occur when using undici 6.x without importing the http module
- node 24.x, which does not exhibit the issue, uses undici 7.x internally
- when http is imported,
undici.getGlobalDispatcher() instanceof undici.Dispatcher
returns false. I assume this happens because the default globalDispatcher resides in globalThis and is initialized by the built-in version of undici
import 'node:http';
import undici from 'undici';
console.log(undici.getGlobalDispatcher() instanceof undici.Dispatcher) // false
allandiegoasilva
Metadata
Metadata
Assignees
Labels
No labels