bun icon indicating copy to clipboard operation
bun copied to clipboard

Undici.getGlobalDispatcher() is undefined

Open gawgua opened this issue 2 years ago • 3 comments

What version of Bun is running?

1.0.7+b0393fba6200d8573f3433fb0af258a0e33ac157

What platform is your computer?

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

call getGlobalDispatcher() from "undici" package

What is the expected behavior?

the function exists in the packages source code, so it shouldnt say undefined.

What do you see instead?

image usage of undici in discord.js REST

Additional information

Heard that "undici" is overridden by Bun implementation.

gawgua avatar Oct 28 '23 13:10 gawgua

Bun version: 1.0.25 (a8ff7be6) Same issue, is it solved?

Jinghao1209 avatar Feb 02 '24 19:02 Jinghao1209

Bun v1.1.5

Same issue.

vitalygashkov avatar Mar 24 '24 16:03 vitalygashkov

Bun v1.1.13

SyntaxError: Export named 'getGlobalDispatcher' not found in module 'undici'.

image

phrynus avatar Aug 27 '24 10:08 phrynus

Yeah just came to try bun on a few of my projects, 1.1.20 here

❯ bun run lib/index.ts 
1 | (function (entry, fetcher)
    ^
SyntaxError: Export named 'getGlobalDispatcher' not found in module 'undici'.

Stono avatar Sep 26 '24 12:09 Stono

I also have this problem, it prevents me from being able to run Miniflare on Bun. Bun version is 1.1.34

1 | import undici from "undici";
2 | 
3 | const dispatcher = undici.getGlobalDispatcher();
                              ^
TypeError: undici.getGlobalDispatcher is not a function. (In 'undici.getGlobalDispatcher()', 'undici.getGlobalDispatcher' is undefined)

zemjr avatar Nov 02 '24 17:11 zemjr