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

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

Closed
timsuchanek opened this issue Nov 24, 2023 · 2 comments · Fixed by #990

Comments

@timsuchanek
Copy link

Describe the bug

When using fetch, I get this warning from the latest Node.js (v21.2.0):

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

To Reproduce Steps to reproduce the behavior:
Just use the latest version of @whatwg-node/fetch with Node v21.2.0.
I get it with this simple script:

import { fetch } from '@whatwg-node/fetch'

fetch('https://www.npmjs.com/package/@whatwg-node/fetch')
  .then((res) => res.text())
  .then((x) => console.log(x.slice(0, 100)))

Expected behavior
Not getting this warning

Environment:

  • OS: MacOS 14.1.1
  • @whatwg-node/fetch: 0.9.14
  • NodeJS: v21.2.0

Additional context
If you fix this, other libraries like OpenAI could benefit from this, as they have the same issue coming from node-fetch:
openai/openai-node#527

@ardatan
Copy link
Owner

ardatan commented Nov 24, 2023

Hmm not sure how they benefit from this because node-fetch is not in this repo and it is not maintained by us -> This is their repo https://github.com/node-fetch/node-fetch

We don't use punycode directly in @whatwg-node/fetch and probably it comes from a dependency we have.

@Urigo
Copy link
Collaborator

Urigo commented Dec 2, 2023

@timsuchanek are you sure this is the only thing you've done to get this error?
can you share a repo we could run?

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 a pull request may close this issue.

3 participants