lquixada / cross-fetch

Universal WHATWG Fetch API for Node, Browsers and React Native.
MIT License
1.67k stars 104 forks source link

update to node-fetch@3 #118

Closed jimmywarting closed 2 years ago

jimmywarting commented 2 years ago

Any thoughts on start using node-fetch v3 It's built as ESM only doe...

lquixada commented 2 years ago

I've tried using it but it wasn't straight forward to add it to the lib. cross-fetch is CJS.

jimmywarting commented 2 years ago

any chance that this could be converted to esm as well?

lquixada commented 2 years ago

not seeing that on the near future. might reconsider at some point.

yinzara commented 2 years ago

Please don't

https://github.com/node-fetch/node-fetch/issues/1263

Sorry @jimmywarting , I still don't think you've given enough of a reason that libraries that are targeted at NodeJS should be making this swap now. We're up to 103 to 15 now.

Additionally, TypeScript 4.5 has now removed the ESM NodeJS support from its feature list so users of TypeScript still have to use some of your crazy work arounds to be able to use ESM only libraries. Hopefully TypeScript 4.6 will have this feature and it'll come soon. https://www.infoworld.com/article/3637149/typescript-delays-esm-support-for-nodejs.html

LiangXuehongBJ commented 2 years ago

Hi. Is there a plan(timeline) to using node-fetch v3? We are using some other package which uses package cross-fetch as dependency. But there is an CVE-2022-0235 vulnerability (Medium) detected in node-fetch-2.6.1.tgz. Thanks.

Vulnerability Details node-fetch is vulnerable to Exposure of Sensitive Information to an Unauthorized Actor

Publish Date: 2022-01-16

URL: CVE-2022-0235

I've tried using it but it wasn't straight forward to add it to the lib. cross-fetch is CJS.

jimmywarting commented 2 years ago

fyi v2.x got patched and fixed for security reason for ppl who are stuck with cjs

imsys commented 2 years ago

To be more specific, it was fixed on 2.6.7 https://github.com/node-fetch/node-fetch/commit/1ef4b560a17e644a02a3bfdea7631ffeee578b35 We just need someone to fix the warning for 2.6.7.

imsys commented 2 years ago

Update, the warning is fixed for:

Affected versions

>= 3.0.0, < 3.1.1
< 2.6.7

Patched versions

3.1.1
2.6.7
lquixada commented 2 years ago

cross-fetch@3.1.5 was released with node-fetch@2.6.7.