-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Open
Description
Version
v24.13.1
Platform
Darwin <hostname> 24.6.0 Darwin Kernel Version 24.6.0: Wed Nov 5 21:34:00 PST 2025; root:xnu-11417.140.69.705.2~1/RELEASE_ARM64_T8132 arm64
Subsystem
No response
What steps will reproduce the bug?
In a project that uses punycode somewhere.
NODE_OPTIONS='--trace-deprecation' npm t
or more concretely (although obviously in this case it's trivial to identify the source):
npm init -y
npm i psl@1.8.0
node --trace-deprecation -e 'require("psl")'
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
I would expect a trace telling me which package/file is requiring punycode
What do you see instead?
What I actually get is
(node:49440) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at node:punycode:7:10
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
at loadBuiltinModule (node:internal/modules/helpers:125:7)
at loadBuiltinWithHooks (node:internal/modules/cjs/loader:1195:15)
at Module._load (node:internal/modules/cjs/loader:1285:48)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
at Module.require (node:internal/modules/cjs/loader:1548:12)
at require (node:internal/modules/helpers:152:16)
Additional information
I note that #56632 will reduce the number of times this warning appears, so perhaps that's good enough - but in general it seems reasonable to say that using --trace-deprecation should actually trace the usage of deprecated code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels