uri-js icon indicating copy to clipboard operation
uri-js copied to clipboard

DeprecationWarning: The `punycode` module is deprecated

Open lorezyra opened this issue 7 months ago • 8 comments

(node:29131) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Can we update the module to replace "punycode"?

lorezyra avatar Jan 08 '24 02:01 lorezyra

See https://github.com/garycourt/uri-js/pull/95

domdomegg avatar Jan 13 '24 14:01 domdomegg

I've published a fork that I intend to keep maintaining that addresses this issue: https://www.npmjs.com/package/toad-uri-js

kibertoad avatar Feb 09 '24 19:02 kibertoad

any update on this?

tianyingchun avatar Apr 17 '24 10:04 tianyingchun

Hi there, I created a replacement for library uri-js

  • Based on Node.js and browser URL api
  • 99% compatible with original URI.js library
  • Solves "The punycode module is deprecated" warning in Node
  • Tested with libraries: ESLint, Webpack, Ajv

https://github.com/andreinwald/uri-js-replace

You can add to package.json of your project:

"overrides": {
    "uri-js": "npm:uri-js-replace"
}

andreinwald avatar Apr 27 '24 14:04 andreinwald

it only can be used in local dev environment, does it can support npm i -g @package/a if @package/a has

"overrides": {
    "uri-js": "npm:uri-js-replace"
}

it seems that npm i -g xxx xxx package won't replace uri-js to uri-js-replace

tianyingchun avatar Apr 28 '24 02:04 tianyingchun

@tianyingchun if any library has "uri-js" as direct dependency, then maintainers of that library can just replace "uri-js" to "uri-js-replace" in dependencies zone of package.json

andreinwald avatar Apr 28 '24 06:04 andreinwald

why uri-js can not bump a new version? cause of so many lib indirect dependents uri-js rather than uri-js-replace?

tianyingchun avatar Apr 28 '24 11:04 tianyingchun

Creator and maintainer @garycourt haven't updated it for last 3 years.

That's why I ended up with the replacement.

andreinwald avatar Apr 28 '24 12:04 andreinwald