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

Drop dependency on uri-js/punycode #2343

Open
gajus opened this issue Oct 30, 2023 · 5 comments
Open

Drop dependency on uri-js/punycode #2343

gajus opened this issue Oct 30, 2023 · 5 comments

Comments

@gajus
Copy link
Contributor

gajus commented Oct 30, 2023

What version of Ajv you are you using?

v6.12.6

What problem do you want to solve?

Logs being flooded with deprecation warnings:

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

What do you think is the correct solution to problem?

  • Drop Node.js support outside of LTE
  • Drop uri-js (which depends on punycode)

Will you be able to implement it?

Yes

Related issues:

Note:

  • My understanding is that the only reason for uri-js is backwards compatibility for older Node.js versions.
@mikicymulate
Copy link

Also happens in newer version
"ajv": "^8.12.0"
#2350

@domdomegg
Copy link

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

@iwasrobbed
Copy link

iwasrobbed commented Mar 8, 2024

uri-js is no longer being maintained, so there's not a great chance of it being fixed upstream.

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 Ajv tests)

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

You can add to package.json of your project:

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

@tianyingchun
Copy link

how progress of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants
@iwasrobbed @gajus @tianyingchun @domdomegg @andreinwald @mikicymulate and others