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.js 21+: DeprecationWarning: The punycode module is deprecated #2622

Open
silverwind opened this issue May 14, 2024 · 0 comments
Open

Node.js 21+: DeprecationWarning: The punycode module is deprecated #2622

silverwind opened this issue May 14, 2024 · 0 comments

Comments

@silverwind
Copy link

silverwind commented May 14, 2024

@stoplight/spectral-runtime and @stoplight/json-ref-readers indirectly depend on node-fetch@2 and tr46@0.0.3 which triggers a runtime deprecation warning in Node.js 21 and above. As per node-fetch/node-fetch#1793 (comment), the likely only option is to upgrade to node-fetch@3:

Warning:

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

Occurence:

$ rg require.+punycode node_modules/tr46/index.js
3:var punycode = require("punycode");

Dependency tree:

└─┬ @stoplight/spectral-cli@6.11.1
  └─┬ @stoplight/spectral-runtime@1.1.2
    └─┬ node-fetch@2.7.0
      └─┬ whatwg-url@5.0.0
        └── tr46@0.0.3
@silverwind silverwind changed the title Need to upgrade to node-fetch@3 to avoid punycode deprecation warning Node.js 21+: DeprecationWarning: The punycode module is deprecated May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants