-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undici fetch overwritten? #4057
Comments
Bun is intentionally overwriting undici so that it uses the global However, we disabled getSetCookie() on |
This will be available once the next canary build finishes compiling (~1 hour)
|
Amazing, Thanks @Jarred-Sumner |
i think this shouldn't be enabled when undici imported, because undici have other features that is needed besides fetch, like i cant use dispatcher or other options from undici, or the experimental h2 support, bun just overrides it. and not just fetch but other methods like undici.request, undici.stream overwritten |
What version of Bun is running?
0.7.3
What platform is your computer?
Darwin 22.5.0 arm64 arm
What steps can reproduce the bug?
I'm trying to use Bun as a dev server as using AWS SAM cli isn't suitable, but I'm not quite ready to use it in production. In production, I need access to the 'Set-Cookie' header, so I'm using undici fetch (have also tried node-fetch) to get access to it as node18 doesn't have a inbuilt way of getting the Set-Cookie header. But when I'm using Bun as a dev server, it seems to overwrite the fetch import and throws an error 'TypeError: headers.getSetCookie is not a function.' (for undici, something similar about headers.raw is not a function in node-fetch)
it should be relatively easy to reproduce
or from node-fetch:
What is the expected behavior?
I should be able to use undici fetch without Bun overwriting it (or at least have the same features when it's overwritten)
What do you see instead?
TypeError: response.headers.getSetCookie is not a function.
Additional information
possibly related commit? 2c0fd28...ba6908a
The text was updated successfully, but these errors were encountered: