-
-
Notifications
You must be signed in to change notification settings - Fork 245
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 from @stoplight/spectral-runtime
#2622
Comments
node-fetch@3
to avoid punycode
deprecation warningpunycode
module is deprecated
Please, any update on this? |
When will this issue be solved? |
punycode
module is deprecatedpunycode
module is deprecated from @stoplight/spectral-runtime
It doesn't seem to happen all the time, just with certain rulesets? What exactly is triggering this error? |
Here is my ruleset in case it matters. It happens while linting a OpenAPI 3.0 file. extends: [[spectral:oas, all]]
rules:
contact-properties: off
info-license: off
license-url: off
oas3-api-servers: off
oas3-parameter-description: off
openapi-tags: off
operation-description: off
operation-tag-defined: off |
That's interesting because it doesn't even define rules, it just switches some off. For me, running Spectral with the built-in ruleset works, but using a |
It is a runtime deprecation in Node.js, these only log when actual code is being ran. The dependency trace above shows it's coming from Why this validator needs to fetch in first place, is another question. Imho such a validator should work offline too. |
I assume reading any ruleset will be done through What I am wondering: If this happens whenever a ruleset is accessed this error should happen a lot, but it doesn't seem to affect many. Is it just that most are using older versions of node? From what I understand punycode was removed in node 11+, so this problem only happens with those versions. But node 11 was released in October 2018, so I would assume many should have newer versions and run into the same error? |
See https://nodejs.org/api/deprecations.html#dep0040-nodepunycode-module:
|
@stoplight/spectral-runtime
and@stoplight/json-ref-readers
indirectly depend onnode-fetch@2
andtr46@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 tonode-fetch@3
:Warning:
Occurence:
Dependency tree:
The text was updated successfully, but these errors were encountered: