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

Fix punycode deprecation warning since Node 21 #1051

Closed
ehmicky opened this issue Oct 27, 2023 · 2 comments
Closed

Fix punycode deprecation warning since Node 21 #1051

ehmicky opened this issue Oct 27, 2023 · 2 comments

Comments

@ehmicky
Copy link

ehmicky commented Oct 27, 2023

The following warning is currently printed when using Node 21:

(node:17753) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

This is coming from https://github.com/jsdom/whatwg-url/blob/d34854a7af6ed1204f55d7da7761497bad350a7b/src/url-state-machine.js#L2 which is installed through:

└─┬ release-it@16.2.1
  └─┬ @octokit/rest@19.0.13
    └─┬ @octokit/core@4.2.4
      └─┬ @octokit/request@6.2.8
        └─┬ node-fetch@2.6.12
          └── whatwg-url@5.0.0

The latest version of whatwg-url does not print this warning anymore. However, this requires upgrading @octokit/rest from v19 to v20. Doing so would drop support for Node 16 (which is not officially supported anymore by Node.js).

This would also remove the agent feature, which is currently used by the github.proxy option.

if (proxy) {
options.request.agent = new ProxyAgent(proxy);
}

The original PR that removed that feature is octokit/request.js#599. Instead, a custom fetch should be passed instead. If support for Node <18.13.0 is removed, the global fetch() method can be used without printing an experimental warning. Under the hood, it uses undici.fetch(). An Agent can be passed, but I am unclear whether it must be an undici Agent (which would require adding undici as a dependency) or a core Node.js http Agent.

@ehmicky ehmicky changed the title Fix punycode deprecation warning Fix punycode deprecation warning since Node 21 Oct 27, 2023
@webpro
Copy link
Collaborator

webpro commented Oct 31, 2023

Thanks for the detailed breakdown @ehmicky, I'll look into it.

@webpro
Copy link
Collaborator

webpro commented May 8, 2024

This should've been fixed by ebc2754 and releasing v17.

@webpro webpro closed this as completed May 8, 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

No branches or pull requests

2 participants