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

feat: remove node-fetch from lib #67

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

mlecoq
Copy link
Contributor

@mlecoq mlecoq commented Apr 24, 2024

I'd like to use this lib on an edge environment (Vercel) and node-fetch has incompatible dependencies

The goal of this pr is to use node / edge built-in fetch

@valeriansaliou
Copy link
Owner

I’d like to keep support for legacy NodeJS versions in this library, if possible down to 12 or 14 since it’s still being used in legacy Node production systems, wouldn’t there be a way to selectively import node-fetch for environments that do not have native fetch?

@adrai
Copy link
Contributor

adrai commented Apr 25, 2024

@mlecoq
Copy link
Contributor Author

mlecoq commented Apr 25, 2024

Could we just create a new major version ?

For older versions of node, people could still use previous version of the lib

Node v22 has just arrived, node 18 is in lts

@mlecoq
Copy link
Contributor Author

mlecoq commented May 7, 2024

Hi @valeriansaliou , I have updated the PR to use cross-fetch as suggested by @adrai and updated minimum node version to 14 (cross-fetch has dropped support for 10 and 12)

@mo
Copy link

mo commented Sep 17, 2024

I just upgraded to node 22 (soon LTS) and I got a bunch of punycode module errors caused by this dependency chain:
└─┬ [email protected]
└─┬ [email protected]
└── [email protected]

whatwg-url fixed the punycode issue in v9 and node-fetch started to use whatwg-url v9 in the node-fetch v3 release so the punycode error will be gone if sales-tax either removes node-fetch or upgrades to a 3.x version of node-fetch

@mo
Copy link

mo commented Sep 17, 2024

running with NODE_OPTIONS="--disable-warning DEP0040" will disable the deprecation warning for punycode

@valeriansaliou valeriansaliou merged commit 13cc90b into valeriansaliou:master Sep 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.

4 participants