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 DeprecationWarning for newer versions of node #1392

Open
dante0624 opened this issue Dec 13, 2023 · 0 comments
Open

Fix DeprecationWarning for newer versions of node #1392

dante0624 opened this issue Dec 13, 2023 · 0 comments

Comments

@dante0624
Copy link

Describe the bug
When using htmlhint, a deprecation warning appears saying:
"(node:71320) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead."

This module has been deprecated since node v7.0.0

To Reproduce
-- Simply invoke htmlhint via the CLI with a node version newer than v7.0.0

Cause of Error
I backtracked to see where this punycode module is invoked. The root cause is version locking the dependency "node-fetch" to version "2.6.2" within package.json.

This is a much older version of node-fetch, which itself has a dependency of "whatwg-url" at version "5.0.0". This is the package which finally uses the punycode module. On my machine, I simply opened the file htmlhint/node_modules/whatwg-url/lib/url-state-machine.js and saw that line 2 was "const punycode = require("punycode");"

Solution
Bumping node-fetch to a newer version will likely solve this problem. Hope this is all helpful!

Importance
Although this issue does not break htmlhint at the moment, it may break it in later versions of node

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

1 participant