Closed lgants closed 1 year ago
@lgants Thanks for the heads up.
I just ran across an issue with the native fetch that was reported in the underlying node-fetch
package:
https://github.com/node-fetch/node-fetch/issues/1566
The workaround was to explicitly disable native fetch via --no-experimental-fetch
It would be great to identify if/when cross-fetch needs this flag. Do you think polyfill is more likely than ponyfill to need this flag?
By my reading of node-polyfill.js, the native fetch will be used instead of node-fetch.
@lgants thanks for taking the time to write this report. Currently, there is no plan to detect native node fetch implementation but I'll keep these issues in mind if something changes. Closing this for now.
I recently migrated from
isomorphic-unfetch
tocross-fetch
because following my upgrade to Node v18, which introduced a native fetch API, theisomorphic-unfetch
library (v3.1.0) began dispatching server requests via the new/experimental fetch API. Unfortunately, that can be very problematic (as I discovered) because: 1) The Node runtime message clearly states:ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
2) The fetch implementation usesundici
, which doesn't document certain forbidden headers - see GitHub issue here 3) Even if the forbidden headers were documented, certain state management libraries automatically inject (potentially forbidden) headers. That includes mine, which injectsConnection
and cannot be overrridenSo, this is just a suggestion to document that additional benefit of
cross-fetch
and request not to change that behaviorThanks for maintaining the library and supporting open-source!