-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: add undici
to satisfy peer dep requirements
#78
Conversation
The module `native-fetch` requires `undici` to be installed as its peer dependency. Before this change, `pnpm add` was reporting a missing peer dependency. dependencies: + dns-over-http-resolver 2.1.0 WARN Issues with peer dependencies found . └─┬ dns-over-http-resolver 2.1.0 └─┬ native-fetch 4.0.2 └── ✕ missing peer undici@"*" Peer dependencies that should be installed: undici@"*" With this change in place, there are no warnings reported. dependencies: + dns-over-http-resolver 2.1.1 Progress: resolved 9, reused 9, downloaded 0, added 9, done Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
This was done on purpose to allow consumers to control the version of node 18 has global fetch so hopefully this whole sorry mess will go away soon, likely when electron ships with node 18 (landed in v23 nightlies a couple of weeks ago, so probably in a couple of months time?). |
🎉 This PR is included in version 2.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you for explaining the context 👍🏻
I am looking forward to that! At the moment, A possible blocker is that native
Compare that with
|
Node 18 now has [global fetch](https://nodejs.org/en/blog/announcements/v18-release-announce) and given that electron now ships with [node 18 by default](electron/electron#36924), we don't need the polyfill anymore. Related: #78 BREAKING CHANGE: requires node 18+
The module
native-fetch
requiresundici
to be installed as its peer dependency.Before this change,
pnpm add
was reporting a missing peer dependency.With this change in place, there are no warnings reported.
To be honest, I think it would be better to add
undici
as a dependency tonative-fetch
, as that would fix the problem for all consumers ofnative-fetch
. However, in libp2p/js-libp2p#1487, @achingbrain suggested to fix the problem in this repo, so here we are.Fixes #44