firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

Deprecation Warning: `punycode` module used in `whatwg-url`

Open madhanmaaz opened this issue 6 months ago • 6 comments

When running the app with deprecation tracing enabled, I get the following warning related to the deprecated punycode module:

(node:12252) [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:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100: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:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at Object.<anonymous> (C:\Users\soldier64\Documents\Github\sellspree\node_modules\whatwg-url\lib\url-state-machine.js:2:18)

This warning originates from the whatwg-url package, which imports the deprecated core punycode module.

Suggested Fix:

Try updating the whatwg-url package to the latest version where the deprecated punycode module is no longer used.

Environment: OS: Windows 10 Pro Education / 19045.2965 Node.js version: v22.11.0

Please consider updating the dependency to eliminate the usage of deprecated core modules

madhanmaaz avatar Jun 16 '25 06:06 madhanmaaz

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jun 16 '25 06:06 google-oss-bot

Hey @madhanmaaz , thank you for reporting this issue. We don't have a direct dependency to whatwg-url in this SDK. I believe it is a transient dependency from firestore. Let me reach out to the team and see what we can do to resolve this.

└─┬ @google-cloud/[email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected]

lahirumaramba avatar Jun 24 '25 15:06 lahirumaramba

@google-cloud/firestore is planning to update google-gax to version ^5.0.0. The upgrade will resolve this issue and occur in the next major version of @google-cloud/firestore. However, I cannot offer a specific date for the release.

MarkDuckworth avatar Jun 24 '25 23:06 MarkDuckworth

Great, thank you

madhanmaaz avatar Jun 25 '25 03:06 madhanmaaz

Since the punycode dependency was removed in whatwg-url v9.0.0 I believe you can simply override dependency in your package.json like the following

  "overrides": {
    "firebase-admin": {
      "whatwg-url": "^9.0.0"
    }
  },

sturman avatar Jul 24 '25 10:07 sturman

Version 9 of whatwg-url still failed for me because the version of tr46 that is used has punycode installed via package.json, but is incorrectly require-ing it into the code. I'm using same "overrides" method as @sturman, but with "whatwg-url": "^14.2.0"

brian-weasner avatar Sep 08 '25 22:09 brian-weasner