Skip to content

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

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

Closed
3 tasks done
betimer opened this issue Apr 9, 2025 · 5 comments

Comments

@betimer
Copy link

betimer commented Apr 9, 2025

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/aws-serverless

SDK Version

9.12.0

Framework Version

Node 22

Link to Sentry event

No response

Reproduction Example/SDK Setup

Error log:

ERROR	(node:8) [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:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:110:7)
    at Function._load (node:internal/modules/cjs/loader:1080:17)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1311:12)
    at Module.o (/node_modules/require-in-the-middle/index.js:256:27)
    at Module.CS._require.eo.require (/node_modules/require-in-the-middle/index.js:181:27)

Steps to Reproduce

Package that @sentry/aws-serverless used

PS C:\repos\serverless-backend> npm ls require-in-the-middle
[email protected] C:\repos\serverless-backend
└─┬ @sentry/[email protected]
  └─┬ @opentelemetry/[email protected]
    └── [email protected]

Expected Result

Fix the package issue for @opentelemetry/instrumentation

Actual Result

Using deprecated function and show warnings in AWS Lambda

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 9, 2025
@github-actions github-actions bot added the Package: aws-serverless Issues related to the Sentry AWS Serverless SDK label Apr 9, 2025
@s1gr1d
Copy link
Member

s1gr1d commented Apr 10, 2025

Hello, can you run npm explain (docs) to see which package is responsible for installing punycode? This issue probably has to be fixed by the package using punycode as they mention that it has to be imported in a special way.

Cross-Linking this as the issue has been already posted in require-in-the-middle: nodejs/require-in-the-middle#95

@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Apr 10, 2025
@stephanie-anderson stephanie-anderson removed the Package: aws-serverless Issues related to the Sentry AWS Serverless SDK label Apr 16, 2025
@betimer
Copy link
Author

betimer commented Apr 23, 2025

@s1gr1d it shows in eslint, but the final bundle I am using esbuild and eslint is not included in the final bundle. The final bundle if I run npm ls require-in-the-middle, it only shows @sentry/aws-serverless is using it.

PS C:\repos\serverless-backend> npm explain punycode
[email protected] dev
node_modules/punycode
  punycode@"^2.1.0" from [email protected]
  node_modules/uri-js
    uri-js@"^4.2.2" from [email protected]
    node_modules/ajv
      ajv@"^6.12.4" from @eslint/[email protected]
      node_modules/@eslint/eslintrc
        @eslint/eslintrc@"^3.3.1" from [email protected]
        node_modules/eslint
          dev eslint@"^9.25.1" from the root project
          peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
          node_modules/@eslint-community/eslint-utils
            @eslint-community/eslint-utils@"^4.4.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/utils
              @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
              node_modules/@typescript-eslint/eslint-plugin
                dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
              @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
              node_modules/@typescript-eslint/type-utils
                @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
                node_modules/@typescript-eslint/eslint-plugin
                  dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
            @eslint-community/eslint-utils@"^4.2.0" from [email protected]
          peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/eslint-plugin
            dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/parser
            dev @typescript-eslint/parser@"^8.31.0" from the root project
            peer @typescript-eslint/parser@"^8.0.0 || ^8.0.0-alpha.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/eslint-plugin
              dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/type-utils
            @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/eslint-plugin
              dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/utils
            @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/eslint-plugin
              dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
            @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/type-utils
              @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
              node_modules/@typescript-eslint/eslint-plugin
                dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          peer eslint@">=7.0.0" from [email protected]
          node_modules/eslint-config-prettier
            dev eslint-config-prettier@"^10.1.2" from the root project
      ajv@"^6.12.4" from [email protected]
      node_modules/eslint
        dev eslint@"^9.25.1" from the root project
        peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
        node_modules/@eslint-community/eslint-utils
          @eslint-community/eslint-utils@"^4.4.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/utils
            @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/eslint-plugin
              dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
            @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/type-utils
              @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
              node_modules/@typescript-eslint/eslint-plugin
                dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          @eslint-community/eslint-utils@"^4.2.0" from [email protected]
        peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
        node_modules/@typescript-eslint/eslint-plugin
          dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
        peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
        node_modules/@typescript-eslint/parser
          dev @typescript-eslint/parser@"^8.31.0" from the root project
          peer @typescript-eslint/parser@"^8.0.0 || ^8.0.0-alpha.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/eslint-plugin
            dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
        peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
        node_modules/@typescript-eslint/type-utils
          @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/eslint-plugin
            dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
        peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/[email protected]
        node_modules/@typescript-eslint/utils
          @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/eslint-plugin
            dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
          @typescript-eslint/utils@"8.31.0" from @typescript-eslint/[email protected]
          node_modules/@typescript-eslint/type-utils
            @typescript-eslint/type-utils@"8.31.0" from @typescript-eslint/[email protected]
            node_modules/@typescript-eslint/eslint-plugin
              dev @typescript-eslint/eslint-plugin@"^8.31.0" from the root project
        peer eslint@">=7.0.0" from [email protected]
        node_modules/eslint-config-prettier
          dev eslint-config-prettier@"^10.1.2" from the root project

@getsantry getsantry bot moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3 Apr 23, 2025
Copy link
Member

mydea commented Apr 23, 2025

I would assume that require-in-the-middle is not actually the culprit here, but showing up because it is wrapping modules under the hood, maybe 🤔 Your logs also show that punycode actually comes from eslint, so I'd look into updating this to get rid of this! It does not appear as if this is related to us, we do not ship any code that depends on punycode as far as I can tell.

@getsantry getsantry bot moved this from Waiting for: Product Owner to Waiting for: Community in GitHub Issues with 👀 3 Apr 23, 2025
@s1gr1d
Copy link
Member

s1gr1d commented Apr 23, 2025

From what I see after a quick search in the eslint repository, it's an issue that's already opened multiple times there (https://github.com/eslint/eslint/issues?q=is%3Aissue%20deprecation%20punycode%20).

Apparently Node 22.14.0 stopped emitting this warning: eslint/eslint#19375 (comment)

Copy link
Member

mydea commented May 7, 2025

Closing this as it does not seem to be originating from our code.

@mydea mydea closed this as completed May 7, 2025
@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants