unfetch icon indicating copy to clipboard operation
unfetch copied to clipboard

isomorphic-unfetch: Consider making node-fetch a peerDependency

Open jamiechong opened this issue 4 years ago • 8 comments

I have the case where I'd like to have better control of the version of node-fetch used (v3.x beta). If it were a peer dependency I'd be able to do this.

jamiechong avatar Sep 15 '20 22:09 jamiechong

Definitely open to this.

developit avatar Sep 29 '20 14:09 developit

Peer dependencies are not meant to be optional. This will cause problems with non-node installs.

carlpaten avatar Jun 29 '21 18:06 carlpaten

How about at least adding a peer dependency on @types/node-fetch, so building with this package doesn't fail? (see #96)

mindplay-dk avatar Aug 02 '21 10:08 mindplay-dk

Fully support this since unfetch bundles its own type definitions. Per @mindplay-dk's own comment in that thread,

But either way, it's currently an undeclared dependency - you have to get a build failure and then manually install the package, so I think either that should be fixed, or the dependency should be removed?

E: I wonder if you shouldn't open a separate issue for visibility.

carlpaten avatar Aug 02 '21 14:08 carlpaten

@jamiechong you can use yarn and resolutions field in package.json to force exact version of dependencies. But be careful, it could break things.

JustFly1984 avatar Sep 01 '21 11:09 JustFly1984

@developit can node-fetch be updated to v3.1.0 please?

matheo avatar Jan 02 '22 02:01 matheo

@matheo want to open a PR?

developit avatar Jan 02 '22 02:01 developit

@developit , I tried my best to create #156 , but I am stuck to fix the test cases. Can you please take a look?

RishikeshDarandale avatar Feb 03 '22 09:02 RishikeshDarandale