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: The punycode module is deprecated #620

Open
MichaelGoberling opened this issue Jun 11, 2024 · 2 comments
Open

DeprecationWarning: The punycode module is deprecated #620

MichaelGoberling opened this issue Jun 11, 2024 · 2 comments

Comments

@MichaelGoberling
Copy link
Contributor

With Node 22, the following error message is output anytime aio is run:

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

Fix recommended by Node here: https://nodejs.org/api/punycode.html#punycode. We'll likely need to figure out where punycode is being used and replace it with the userland version.

@ConnorJamesLow
Copy link

Full deprecation trace (using node's --trace-deprecation flag):

(node:46829) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1063:17)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/@adobe/aio-cli/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1460:14)

@ConnorJamesLow
Copy link

ConnorJamesLow commented Aug 14, 2024

This is due to node-fetch requiring an out-of-date version (5.0.0, current is 14.0.0) of whatwg-url (https://www.npmjs.com/package/whatwg-url/v/5.0.0?activeTab=code) which includes an out-of-date version of tr-46 which incorrectly imported the puny-code package for versions 3.0.0 and older.

This project either needs to upgrade to a 3.x.x version of node-fetch, or node-fetch needs to upgrade their 2.x.x's whatwg-url version to one that supports a newer version of tr-46.

Update
Third option is to override the version of whatwg-url: node-fetch/node-fetch#1797 (comment).

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

2 participants