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

DEP0040 cypress install causes node 22 punycode deprecation #29774

Closed
MikeMcC399 opened this issue Jun 29, 2024 · 7 comments
Closed

DEP0040 cypress install causes node 22 punycode deprecation #29774

MikeMcC399 opened this issue Jun 29, 2024 · 7 comments

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Jun 29, 2024

Current behavior

Executing

cypress install

causes a deprecation warning when run under Node.js 22

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

Desired behavior

Executing

cypress install

should not show any deprecation warning when run under any supported version of Node.js, including 22.x.

Test code to reproduce

mkdir cy-test
cd cy-test
git init
npm init -y
npm install cypress -D
npx cypress install

Cypress Version

First reported on version: 13.12.0
Reproducible also on: 13.15.0

Node version

v22.3.0 v22.9.0

Operating System

Ubuntu 22.04.4 LTS

Debug Logs

$ export NODE_OPTIONS='--trace-deprecation'
npx cypress install
(node:3719) [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:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1063:17)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/home/mike/github/tmp/cy-test/node_modules/psl/index.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1460:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
    at Module.load (node:internal/modules/cjs/loader:1275:32)
    at Module._load (node:internal/modules/cjs/loader:1091:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)

Cypress 13.12.0 is installed in /home/mike/.cache/Cypress/13.12.0

Skipping installation:

  Pass the --force option if you'd like to reinstall anyway.

...

$ npm ls psl
cy-test@1.0.0 /home/mike/github/tmp/cy-test
└─┬ cypress@13.12.0
  └─┬ @cypress/request@3.0.1
    └─┬ tough-cookie@4.1.4
      └── psl@1.9.0

Other

This issue is related to

@MikeMcC399 MikeMcC399 changed the title cypress install causes node 22 punycode deprecation cypress install causes node 22 punycode deprecation Aug 28, 2024
@MikeMcC399
Copy link
Contributor Author

tough-cookie@5.0.0 resolves this issue, however there has been no update made to @cypress/request yet to use this fixed version:

cy-test@1.0.0 
└─┬ cypress@13.14.2
  └─┬ @cypress/request@3.0.5
    └─┬ tough-cookie@4.1.4
      └── psl@1.9.0

@MikeMcC399
Copy link
Contributor Author

Node.js 22.x is planned for active LTS status starting Oct 29, 2024.

@MikeMcC399 MikeMcC399 changed the title cypress install causes node 22 punycode deprecation DEP0040 cypress install causes node 22 punycode deprecation Oct 19, 2024
@MikeMcC399
Copy link
Contributor Author

@Tiuipuv
Copy link

Tiuipuv commented Oct 28, 2024

We are also having this issue. Any eta to a merge on @cypress/request repo of #73?

@MikeMcC399
Copy link
Contributor Author

@Tiuipuv

I have seen that this is merged and there is a new release @cypress/request@3.0.6

@MikeMcC399
Copy link
Contributor Author

@MikeMcC399
Copy link
Contributor Author

Verification

Ubuntu 24.04.1 LTS, Node.js 22.11.0 LTS, Cypress 13.15.1

Current state

git clone https://github.com/cypress-io/cypress-example-kitchensink
cd cypress-example-kitchensink
git clean -xfd # only needed if repeating
git checkout b9b42b836369d63767f583edce5a4de5dfab32b7 # locked to @cypress/request@3.0.5
npm ci
npm install cypress@13.15.1 # demonstrates that this version does not solve issue
npm ls @cypress/request
npx cypress install

shows DeprecationWarning

$ npx cypress install
(node:4469) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

Cypress 13.15.1 is installed in /home/mike/.cache/Cypress/13.15.1

Skipping installation:

  Pass the --force option if you'd like to reinstall anyway.

After PR #30488

npm install https://cdn.cypress.io/beta/npm/13.15.2/linux-x64/develop-0e5b131b467f4aa73a9f0ca5cdb1168ce58dd447/cypress.tgz # fixes issue
npm ls @cypress/request
npx cypress install

no more DeprecationWarning:

$ npx cypress install
⚠ Warning: You are installing a pre-release build of Cypress.

Bugs may be present which do not exist in production builds.

This build was created from:
  * Commit SHA: 0e5b131b467f4aa73a9f0ca5cdb1168ce58dd447
  * Commit Branch: develop
  * Commit Timestamp: 2024-10-30T13:08:14.000Z


Cypress 13.15.2 is installed in /home/mike/.cache/Cypress/beta-13.15.2-develop-0e5b131b

Skipping installation:

  Pass the --force option if you'd like to reinstall anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants