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

[v22.8.0] - DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. #54938

Closed
MariuzM opened this issue Sep 14, 2024 · 8 comments
Labels
invalid Issues and PRs that are invalid.

Comments

@MariuzM
Copy link

MariuzM commented Sep 14, 2024

Version

v22.8.0

Platform

Mac

Subsystem

No response

What steps will reproduce the bug?

npm run dev or build

How often does it reproduce? Is there a required condition?

Every time i run this command

What is the expected behavior? Why is that the expected behavior?

Not to show message

What do you see instead?

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

Additional information

No response

@avivkeller avivkeller closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2024
@avivkeller avivkeller added the invalid Issues and PRs that are invalid. label Sep 14, 2024
@avivkeller
Copy link
Member

That deprecation warning just means that something is using punycode, which has been deprecated.

@pplmx
Copy link

pplmx commented Oct 20, 2024

Hi, @redyetidev

It appears to be an issue with Node.js itself, right? As I observed the following:

$ node -v
v23.0.0

$ pnpm ls --depth 10 | grep punycode | wc -l
0

$ node --trace-deprecation
Welcome to Node.js v23.0.0.
Type ".help" for more information.
> punycode
{
  version: '2.1.0',
  ucs2: { decode: [Function: ucs2decode], encode: [Function: ucs2encode] },
  decode: [Function: decode],
  encode: [Function: encode],
  toASCII: [Function: toASCII],
  toUnicode: [Function: toUnicode]
}
> (node:2756) [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:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:112:7)
    at Function._load (node:internal/modules/cjs/loader:1110:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1350:12)
    at get (node:internal/modules/helpers:226:33)
    at REPL1:1:1

>

@avivkeller
Copy link
Member

No, that's intentional. The punycode builtin is deprecated

@Goobles
Copy link

Goobles commented Dec 6, 2024

Can there be any more support on this? Either just outright remove punycode from Node.js so library authors are forced to update to the userland alternative (or the require('punycode') suddenly resolves to the userland version instead of the builtin when it is installed downstream), or add some kind of way to mute deprecation warnings of nested dependencies.
Almost every older version of cli tools I use presents me with this warning, which is becoming very noisy.

The other alternative I have is globally disabling all node warnings which isn't ideal either.

@MariuzM
Copy link
Author

MariuzM commented Dec 6, 2024

Agree this warning of this punycode is such a long long issue that plagued Node for many years is getting annoying. I wish there was a better way to handle this without bombarding CLI with these warnings

@Goobles
Copy link

Goobles commented Dec 6, 2024

For things where I can control the entrypoint, you can patch punycode requires away with module-alias, as described in this issue: mathiasbynens/punycode.js#137

But for cli tools like @salesforce/cli ?
image

Apparently Node.js punycode has been deprecated since Node.js v7.0.0 in Oct 2016, Isn't it long overdue to actually be removed then?

@andrewplummer
Copy link

I see punycode warnings everywhere now. Everywhere.

I now do things now like resolutions/overrides. Surely that won't bite me later right? ...it's probably fine.
I now think things like "I guess I won't upgrade this project because then I won't get those warnings".

I'm sure this warning wasn't added on a whim. I'm not even saying it should be removed. I'm just saying these are the things I think about now.

@richardlau
Copy link
Member

The next Node.js 22 release, should include #56632 which will limit warnings to only emit outside of node_modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

6 participants