jsdom / tr46

An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing.
MIT License
32 stars 14 forks source link

Remove "punycode" dependency as it is deprecated. #51

Closed AcclaimedAP closed 7 months ago

AcclaimedAP commented 7 months ago

Punycode is deprecated.

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

It's imported here: https://github.com/jsdom/tr46/blob/d6cd9a73bb9eb4b3defb50c348db2a60704d1367/index.js#L3

const punycode = require("punycode/");

It's also used a few times inside of the index.js file.

AcclaimedAP commented 7 months ago

It isn't a huge issue, as it isn't causing any issues for me, it is mostly a potential issue for the future.

If you're encountering this issue, you can run node with the --no-deprecation flag, and hopefully it will be fine.

It is weirdly enough not using the node bundled version, but rather the "correct" one. However it is still throwing out warnings after using npm install punycode --save which supposedly should fix this. I will be looking around a bit to see if I personally find any solution, but if anyone figure one out, I'd gladly hear. It's currently the only module in my project that uses punycode.

Edit:

Closing as I am a dumbass.

For anyone that somehow traced it to tr46, it isn't(in my case)

The culprit is "psl". Simply adding a forward slash in it's index made it real quiet.

domenic commented 7 months ago

This package depends on npm punycode, not built-in punycode, so cannot cause the issue you are seeing.