-
Notifications
You must be signed in to change notification settings - Fork 12
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
DeprecationWarning: The punycode
module is deprecated
#29
Comments
node-fetch 3 introduces a lot of breaking changes, the most problematic one being that the package has been converted to an ES module which makes it impossible to import synchronously. |
But in this case there's not much of a choice, I will see if I can figure something out. |
This project can also be turned into ESM :) |
I know :) However, I think that a lot of situations in which a synchronous version of fetch is required or useful, will not allow asynchronous I see two workarounds:
|
@larsgw You can fork node-fetch 2.x and update whatwg-url, then everything be fine |
I don't think so, use @larsgw/node-fetch in your module and node-fetch outside the module so it won't cause problems |
I think I will close this issue in favor of #32 since it is basically about the same thing. |
If you are using windows and still getting this warning after updating to node version 21.1.0 then you need to update the npm itself. type 'npm install -g npm@latest' in cmd and that probably fix your issue. It worked for me. |
node-fetch 2.x, followed by sync-fetch, does not support Node.js 21 and higher fully as it relies on punycode depending from whatwg-url 5.0.0. See also larsgw/sync-fetch#29 This change replaces sync-fetch with await and node-fetch v3. Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
node-fetch 2.x, followed by sync-fetch, does not support Node.js 21 and higher fully as it relies on punycode depending from whatwg-url 5.0.0. See also larsgw/sync-fetch#29 This change replaces sync-fetch with await and node-fetch v3. Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
node-fetch 2.x, followed by sync-fetch, does not support Node.js 21 and higher fully as it relies on punycode depending from whatwg-url 5.0.0. See also larsgw/sync-fetch#29 This change replaces sync-fetch with await and node-fetch v3. Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
jsdom/whatwg-url#191
node-fetch/node-fetch@0959ca9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L63
@larsgw Will you support node-fetch 3.x (or newer)?
The text was updated successfully, but these errors were encountered: