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

DeprecationWarning: Punycode #17720

Closed
jasperkelder opened this issue Nov 6, 2023 · 10 comments
Closed

DeprecationWarning: Punycode #17720

jasperkelder opened this issue Nov 6, 2023 · 10 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint

Comments

@jasperkelder
Copy link

jasperkelder commented Nov 6, 2023

ESLint version

8.53.0

What problem do you want to solve?

One of eslint's dependencies is using a deprecated module, we're currently getting the following warning -> DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.

└─┬ eslint@8.53.0
└─┬ ajv@6.12.6
└─┬ uri-js@4.4.1
└── punycode@2.3.0

What do you think is the correct solution?

Make sure the deprecated module gets replaced in the dependency tree.

@jasperkelder jasperkelder added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint labels Nov 6, 2023
@Rec0iL99
Copy link
Member

Rec0iL99 commented Nov 6, 2023

Hi @jasperkelder, thanks for the issue. I don't think this is something to be solved in ESLint. ESLint directly depends on ajv and there is an open issue addressing this there.

@domdomegg
Copy link
Contributor

I've opened a PR to fix this in uri-js, the package ajv depends on here: garycourt/uri-js#95

@ghost
Copy link

ghost commented Jan 15, 2024

I've opened a PR to fix this in uri-js, the package ajv depends on here: garycourt/uri-js#95

@domdomegg
still not fixed. would also like to note that eslint uses ajv v6.12.6 instead of the latest v8.12.0 from a year ago

@Rec0iL99
Copy link
Member

would also like to note that eslint uses ajv v6.12.6 instead of the latest v8.12.0 from a year ago

@newinfinity12 perhaps this #13888 (comment) will help you understand why ESLint still uses Ajv 6.

@ghost
Copy link

ghost commented Jan 15, 2024

would also like to note that eslint uses ajv v6.12.6 instead of the latest v8.12.0 from a year ago

@newinfinity12 perhaps this #13888 (comment) will help you understand why ESLint still uses Ajv 6.

@Rec0iL99
great resource however that does not change the fact that eslint is indirectly using a deprecated dependency.

Based on the threads created in Ajv and URI.js the blame/fix keeps getting pushed around to different repos. Ajv has not been updated in over a year and URI.js in over 3 years. So based on this info it looks like eslint should switch to a different repo to avoid the deprecation warning altogether

@domdomegg
Copy link
Contributor

I've opened a PR to fix this in uri-js, the package ajv depends on here: garycourt/uri-js#95

@domdomegg still not fixed. would also like to note that eslint uses ajv v6.12.6 instead of the latest v8.12.0 from a year ago

@newinfinity12 the way node resolves dependencies will mean that updating uri-js as a minor or patch version will still fix it, even though eslint uses ajv 6

@ghost
Copy link

ghost commented Jan 15, 2024

I've opened a PR to fix this in uri-js, the package ajv depends on here: garycourt/uri-js#95

@domdomegg still not fixed. would also like to note that eslint uses ajv v6.12.6 instead of the latest v8.12.0 from a year ago

@newinfinity12 the way node resolves dependencies will mean that updating uri-js as a minor or patch version will still fix it, even though eslint uses ajv 6

@domdomegg
The only issue as I mentioned mentioned here #17720 (comment) is that uri-js has not been updated in over 3 years so it will likely not be updated. So what would be the solution? Wait indefinitely until the maintainer of uri-js decides to update it?

@iwasrobbed
Copy link

iwasrobbed commented Mar 8, 2024

@Rec0iL99 eslint will require an update to fix this whenever ajv eventually fixes it, so either way this issue should remain open here (especially given how far behind on major/minor versions eslint is for ajv).

Fyi to all: you can also nvm install 20 && nvm use 20 to go back to Node v20.11.1 and silence it for now until ajv/eslint/etc update their dependencies

@andreinwald
Copy link

Hi there,
I created a replacement for library uri-js as temporal solution.

  • 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 (runned all ESLint tests)

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

You can add to package.json of your project:

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

@alapanerao
Copy link

Hi there, I created a replacement for library uri-js as temporal solution.

  • 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 (runned all ESLint tests)

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

You can add to package.json of your project:

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

Did not work for me.
My node version is 22.1.0

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 5, 2024
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint
Projects
Archived in project
Development

No branches or pull requests

6 participants