Skip to content

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

@RealityCtrl

Description

@RealityCtrl

Describe the bug

Using the client results in a warning for deprecated module punycode.

ERROR	(node:5) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Node.js documentation shows this as Deprecated hence the warning https://nodejs.org/api/punycode.html.

Tracing the issue and it used in the tr64 module

"use strict";

var punycode = require("punycode");
var mappingTable = require("./lib/mappingTable.json");

tr64 is an indirect dependency of this module.

└─┬ @datadog/datadog-api-client@1.53.0
  └─┬ cross-fetch@3.2.0
    └─┬ node-fetch@2.7.0
      └─┬ whatwg-url@5.0.0
        └── tr46@0.0.3

Cross fetch which this module relies on appears to be largely unsupported now, the issue was reported 2 years ago and remains unfixed lquixada/cross-fetch#177 and no releases since 2024.

So it would seem like an alternative to cross-fetch is needed before punycode is removed from the runtime.

To Reproduce
Steps to reproduce the behavior:

Use the library with a node 22 runtime

Expected behavior
Warning is not logged as deprecated module isn't used

Environment and Versions (please complete the following information):
A clear and precise description of your setup:
AWS Lambda Node 22 runtime
Library version - 1.53.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions