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

(node:67219) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. #4758

Open
aseemk opened this issue Oct 3, 2024 · 2 comments

Comments

@aseemk
Copy link

aseemk commented Oct 3, 2024

Hi there,

I've been getting these deprecation warnings from Node. When I run with --trace-deprecation, the stack trace points to this library:

(node:67219) [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:108:7)
    at Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at Hook.Module.require (/Users/aseemk/Projects/Portola/backend/node_modules/.pnpm/[email protected]/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33)
    at require (node:internal/modules/helpers:135:16)

You can see I've even tried upgrading to (what I believe is) the latest dd-trace version 5.23.1, and I'm running the latest Node v22:

$ node --version
v22.9.0

I realize it looks like the actual punycode usage is coming from within Node itself. But is there anything y'all know about or can help with here? Would love to get rid of this warning every time I run my app. =) Thanks!

@seanadkinson
Copy link

I came here looking for help with this issue as well:

(node:28977) [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:108:7)
    at Function.Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at Module.Hook.Module.require (/Users/seanadkinson/code/slt-server/node_modules/dd-trace/packages/dd-trace/src/ritm.js:97:33)
    at require (node:internal/modules/helpers:135:16)

However, because dd-trace is instrumenting code, it looks like the warning is coming from this library, but it may be masking the real culprit.

Indeed, when I comment out dd-trace from my project and re-run, I see that it is actually from the whatwg-url library:

(node:29457) [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:108:7)
    at Function.Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (/Users/seanadkinson/code/slt-server/node_modules/whatwg-url/lib/url-state-machine.js:2:18)

So this likely isn't actually an issue with dd-trace.

@calidan-x
Copy link

Please fix the punycode warning

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

3 participants