Skip to content
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

Replace node-fetch with node-fetch-native #599

Closed
wants to merge 1 commit into from

Conversation

kidonng
Copy link

@kidonng kidonng commented Mar 19, 2023

  • Tests pass
  • Appropriate changes to README are included in PR
  • Types updated

I'm aware this task is already assigned to others, but here I'm proposing it as a bug fix for Deno targeting zx v7. node-fetch seems to cause a infinite loop in Deno:

import 'npm:zx/globals'

fetch('https://example.com') // Infinite loop!

So why node-fetch-native? To sum its readme up:

  • Use native fetch when available (thus doesn't break Deno)
  • Smaller installation size
  • Works with outdated Node version

Thus I consider it a good alternative to removing node-fetch entirely in v8.

This change does introduce a small issue: if TypeScript users have outdated @types/node then RequestInfo and RequestInit types will be missing. I assume this is rare if they are using TypeScript anyway.

@kidonng kidonng mentioned this pull request Mar 19, 2023
3 tasks
@antongolub
Copy link
Collaborator

antongolub commented Mar 18, 2024

Resolved in #722

@antonmedv antonmedv closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants