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

Upgrade to node-fetch 3.x using node-fetch-cjs? #146

Open
valerieernst opened this issue Oct 5, 2022 · 2 comments
Open

Upgrade to node-fetch 3.x using node-fetch-cjs? #146

valerieernst opened this issue Oct 5, 2022 · 2 comments
Labels

Comments

@valerieernst
Copy link

We're running into issues that are solved by node-fetch/node-fetch#671, which is part of the node-fetch 3.0.0 release.

I read through #118 and understand upgrading node-fetch to v3.x+ isn't on the short term roadmap.

Is there any consideration to upgrading using https://github.com/touchifyapp/node-fetch-cjs? Seems like it could be an easier upgrade path.

If it's something you're considering, I'm happy to help out/put up a PR!

@jimmywarting
Copy link

fyi. it's also considerable easy to load node-fetch@3 from cjs using something like async import that works from cjs as well.

const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));

the disadvantage would be that you can't have sync access to Request/Response/Headers etc.
also, node-fetch is kind of being replaced with the built in fetch from NodeJS v18.
so packages like this will not be needed anymore. Just need to update to a newer NodeJS version.

@joealden
Copy link

joealden commented Oct 7, 2024

Alternatively, we could move to https://github.com/unjs/node-fetch-native.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants