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

The punycode module is deprecated. Please use a userland alternative instead. #3301

Closed
cowwoc opened this issue Nov 1, 2024 · 4 comments · Fixed by #3308
Closed

The punycode module is deprecated. Please use a userland alternative instead. #3301

cowwoc opened this issue Nov 1, 2024 · 4 comments · Fixed by #3308
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@cowwoc
Copy link

cowwoc commented Nov 1, 2024

What happened?

Every time pulumi is run, it outputs:

[DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Example

Run pulumi up

Output of pulumi about

CLI
Version      3.137.0
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME                     VERSION
resource  aws                      6.57.0
resource  kubernetes               4.18.2
resource  kubernetes-cert-manager  0.0.7
language  nodejs                   unknown

Host
OS       Microsoft Windows 10 Pro
Version  10.0.19045 Build 19045
Arch     x86_64

This project is written in nodejs: executable='C:\Users\Gili\scoop\apps\nodejs\current\node.exe' version='v23.1.0'

Current Stack: licensed/licensed/local

TYPE                                                         URN
pulumi:pulumi:Stack                                          urn:pulumi:local::licensed::pulumi:pulumi:Stack::licensed-local
pulumi:providers:kubernetes                                  urn:pulumi:local::licensed::pulumi:providers:kubernetes::local
kubernetes:core/v1:Namespace                                 urn:pulumi:local::licensed::kubernetes:core/v1:Namespace::cert-manager
kubernetes:core/v1:Namespace                                 urn:pulumi:local::licensed::kubernetes:core/v1:Namespace::velero
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:core/v1:Secret::cert-manager.cloudflare.api-token
pulumi:providers:kubernetes-cert-manager                     urn:pulumi:local::licensed::pulumi:providers:kubernetes-cert-manager::default_0_0_7
pulumi:providers:pulumi                                      urn:pulumi:local::licensed::pulumi:providers:pulumi::default
kubernetes:helm.sh/v4:Chart                                  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart::minio
kubernetes-cert-manager:index:CertManager                    urn:pulumi:local::licensed::kubernetes-cert-manager:index:CertManager::cert-manager
kubernetes:helm.sh/v3:Release                                urn:pulumi:local::licensed::kubernetes-cert-manager:index:CertManager$kubernetes:helm.sh/v3:Release::cert-manager-helm
kubernetes:core/v1:ServiceAccount                            urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:ServiceAccount::minio:velero/minio
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Secret::minio:velero/minio
kubernetes:core/v1:Service                                   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Service::minio:velero/minio
kubernetes:core/v1:PersistentVolumeClaim                     urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:PersistentVolumeClaim::minio:velero/minio
kubernetes:policy/v1:PodDisruptionBudget                     urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:policy/v1:PodDisruptionBudget::minio:velero/minio
kubernetes:networking.k8s.io/v1:NetworkPolicy                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:networking.k8s.io/v1:NetworkPolicy::minio:velero/minio
kubernetes:cert-manager.io/v1:Issuer                         urn:pulumi:local::licensed::kubernetes:cert-manager.io/v1:Issuer::cert-manager.acme.certificate.issuer
kubernetes:apps/v1:Deployment                                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apps/v1:Deployment::minio:velero/minio
kubernetes:cert-manager.io/v1:Certificate                    urn:pulumi:local::licensed::kubernetes:cert-manager.io/v1:Certificate::cert-manager.certificate
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:core/v1:Secret::velero.repo.credentials
kubernetes:batch/v1:Job                                      urn:pulumi:local::licensed::kubernetes:batch/v1:Job::velero.minio.create-bucket
kubernetes:helm.sh/v4:Chart                                  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart::velero
kubernetes:core/v1:ServiceAccount                            urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:ServiceAccount::velero:velero/velero-server
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:deletebackuprequests.velero.io
kubernetes:rbac.authorization.k8s.io/v1:RoleBinding          urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:RoleBinding::velero:velero/velero-server
kubernetes:rbac.authorization.k8s.io/v1:Role                 urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:Role::velero:velero/velero-server
kubernetes:core/v1:Secret                                    urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Secret::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:serverstatusrequests.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backuprepositories.velero.io
kubernetes:core/v1:Service                                   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:core/v1:Service::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:downloadrequests.velero.io
kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding   urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:rbac.authorization.k8s.io/v1:ClusterRoleBinding::velero:velero-server
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:volumesnapshotlocations.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backupstoragelocations.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:datadownloads.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:podvolumerestores.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:datauploads.velero.io
kubernetes:apps/v1:Deployment                                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apps/v1:Deployment::velero:velero/velero
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:podvolumebackups.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:restores.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:backups.velero.io
kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition  urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:apiextensions.k8s.io/v1:CustomResourceDefinition::velero:schedules.velero.io
kubernetes:velero.io/v1:BackupStorageLocation                urn:pulumi:local::licensed::kubernetes:helm.sh/v4:Chart$kubernetes:velero.io/v1:BackupStorageLocation::velero:velero/backup


Found no pending operations associated with local

Backend
Name           pulumi.com
URL            https://app.pulumi.com/cowwoc
User           cowwoc
Organizations  cowwoc, licensed
Token type     personal

Pulumi locates its logs in C:\Users\Gili\AppData\Local\Temp by default
warning: Failed to get information about the Pulumi program's dependencies: no package-lock.json or yarn.lock file found (searching upwards from [redacted])

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@cowwoc cowwoc added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 1, 2024
@justinvp
Copy link
Member

justinvp commented Nov 1, 2024

I can repro this with:

pulumi new kubernetes-typescript
...
pulumi preview

Modifying Pulumi.yaml to trace node warnings:

name: npunyk8s
runtime:
  name: nodejs
  options:
    packagemanager: npm
    nodeargs: --trace-warnings

And running pulumi preview again:

    (node:38212) [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:113:7)
        at Function._load (node:internal/modules/cjs/loader:1097:17)
        at TracingChannel.traceSync (node:diagnostics_channel:322:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
        at Module.require (node:internal/modules/cjs/loader:1337:12)
        at require (node:internal/modules/helpers:139:16)
        at Object.<anonymous> (/Users/user/npunyk8s/node_modules/whatwg-url/lib/url-state-machine.js:2:18)

Looking at my package-lock.json, it looks like whatwg-url is a dependency of node-fetch:

        "node_modules/node-fetch": {
            "version": "2.7.0",
            "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
            "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
            "license": "MIT",
            "dependencies": {
                "whatwg-url": "^5.0.0"
            },

Which is a dependency of @pulumi/kubernetes:

"node-fetch": "^2.3.0",

Transferring this issue to https://github.com/pulumi/pulumi-kubernetes

@justinvp justinvp transferred this issue from pulumi/pulumi Nov 1, 2024
@vladshcherbin
Copy link

Same, this message comes every time you run pulumi command - so annoying. Any workaround for now?

@vladshcherbin
Copy link

Looking at the repo, it seems like node-fetch is not even used anywhere in the codebase 🤔

@blampe
Copy link
Contributor

blampe commented Nov 11, 2024

Looking at the repo, it seems like node-fetch is not even used anywhere in the codebase 🤔

It is used

import fetch from "node-fetch";

but should just be a matter of updating the dependency.

@blampe blampe removed the needs-triage Needs attention from the triage team label Nov 11, 2024
@blampe blampe closed this as completed in e369135 Nov 26, 2024
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 26, 2024
rquitales added a commit that referenced this issue Dec 5, 2024
### Changed

- [nodejs] Resolves `punycode` deprecation warnings by using native
`fetch` instead of `node-fetch`.
  (#3301)

### Fixed

- `pulumi.com/waitFor` and other await annotations now correctly take
precedence over default await logic.
  (#3329)

- JSONPath expressions used with the `pulumi.com/waitFor` annotation
will no longer hang indefinitely if they match non-primitive fields.
  (#3345)

- [java] CRDs that contain any `x-kubernetes-*` fields can now be
succesfully created and managed by Pulumi.
  (#3325)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants