#How to override bun built-in `undici` version?

1 messages · Page 1 of 1 (latest)

delicate timber
#

Hi, I have a dependency in my project that started using undici v7. Bun provides the v6 of undici when trying to import it, even if I explicitly install v7. It looks like its just hard-coded? Although I couldn't find anything about it in the docs.

How can I install and use undici v7? After installing it with bun i I still get the old version when importing it.

Thank you!

summer nymph
#

i think a sus method is to install as alias but tbh the pollyfill should just be removed

//package.json
"undici-actual": "npm:undici"
delicate timber
#

I tried and it works, the problem is then I have to patch the dependency to use undici-actual where it uses undici is that correct?

summer nymph
#

yeah 😭

#

you cant actually import "undici" anywhere

#

wait i think maybe you can do a sus "undici/index.js" type thing

#

but yeah this has been a very common issue (just search this channel)

#

(good thing is now the node:http apis are pretty accurate so it can work but maybe earlier on it was more reliable to use own fetch)

delicate timber
#

okay thank you very much!

#

Should I open a ticket to remove or update this polyfill?

summer nymph
#

im sure there is an existing gh issue

#

ill try to find tho

#

hmm couldnt find a dedicated thread but it is in roadmap

delicate timber
#

That's awesome! Thanks for the help. If I can help with this somehow please let me know 🙂