GovTechSG / oobee

Oobee (formerly known as Purple A11y) is a customisable, automated web accessibility testing tool that allows software development teams to find and fix accessibility problems to improve persons with disabilities (PWDs) access to digital services.
MIT License
116 stars 43 forks source link

I'm getting this error - The `punycode` module is deprecated. Please use a userland alternative instead. #266

Closed mgifford closed 5 months ago

mgifford commented 9 months ago

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

Probably not critical, but thought it might be good to address.

younglim commented 9 months ago

Hi @mgifford,

I am not able to replicate the deprecation warning of punycode. I have deleted my node_modules folder and package-lock.json file and done npm install on both node v18.x.x and v20.11.0.

The issue you are facing might be due to a different version of node or other reasons.

brianteeman commented 7 months ago

node v21.6.1

same issue as reported by @mgifford

npm ls punycode

├─┬ eslint@8.55.0 │ └─┬ ajv@6.12.6 │ └─┬ uri-js@4.4.1 │ └── punycode@2.3.1 └─┬ jsdom@21.1.2 ├─┬ tough-cookie@4.1.3 │ └── punycode@2.3.1 └─┬ whatwg-url@12.0.1 └─┬ tr46@4.1.1 └── punycode@2.3.1

younglim commented 7 months ago

Hi @brianteeman, are you able to show the full command-line? I am unable to replicate the issue:

Node version

young@youngs-MacBook-Pro purple-a11y % nvm use --lts    
Now using node v20.11.1 (npm v10.2.4)

npm install

young@youngs-MacBook-Pro purple-a11y % npm install
^R########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@aashutoshrathi/word-wrap: sill audit bulk request
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm WARN deprecated dommatrix@1.0.3: dommatrix is no longer maintained. Please use @thednp/dommatrix.

added 744 packages, and audited 745 packages in 8s

161 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Run scan with trace-deprecation

young@youngs-MacBook-Pro purple-a11y % node --trace-deprecation cli -u https://www.tech.gov.sg -p 1 -k "younglim:accessibility@tech.gov.sg" -c 2

 Purple A11y version: 0.9.46 
 Starting scan... 

┌────────────────────────────────────────┐
│ Scan Summary                           │
│                                        │
│ Must Fix: 2 issues / 7 occurrences     │
│ Good to Fix: 6 issues / 26 occurrences │
│ Needs Review: 0 issues / 0 occurrences │
│ Passed: 484 occurrences                │
└────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Report of this run is at a11y-scan-results.zip                  │
│ Results directory is at results/20240314_101154_www.tech.gov.sg │
└─────────────────────────────────────────────────────────────────┘
brianteeman commented 7 months ago
PS D:\repos\purple-a11y> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
PS D:\repos\purple-a11y> npm install

up to date, audited 743 packages in 956ms

161 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS D:\repos\purple-a11y> npm ls punycode
@govtechsg/purple-hats@0.9.46 D:\repos\purple-a11y
├─┬ eslint@8.55.0
│ └─┬ ajv@6.12.6
│   └─┬ uri-js@4.4.1
│     └── punycode@2.3.1 deduped
└─┬ jsdom@21.1.2
  ├─┬ tough-cookie@4.1.3
  │ └── punycode@2.3.1
  └─┬ whatwg-url@12.0.1
    └─┬ tr46@4.1.1
      └── punycode@2.3.1 deduped
PS D:\repos\purple-a11y> node index
┌────────────────────────────────────────────────────────────┐
│ Purple A11y (ver 0.9.46)                                   │
│ We recommend using Chrome browser for the best experience. │
└────────────────────────────────────────────────────────────┘
 To personalise your experience, we will be collecting your name, email address and app usage data.
 Your information fully complies with GovTech's Privacy Policy.
? Name: (node:28704) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

PS D:\repos\purple-a11y> node --trace-deprecation index
┌────────────────────────────────────────────────────────────┐
│ Purple A11y (ver 0.9.46)                                   │
│ We recommend using Chrome browser for the best experience. │
└────────────────────────────────────────────────────────────┘
 To personalise your experience, we will be collecting your name, email address and app usage data.
 Your information fully complies with GovTech's Privacy Policy.
? Name: (node:36972) [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:397:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10)
    at loadBuiltinModule (node:internal/modules/helpers:101:7)
    at Module._load (node:internal/modules/cjs/loader:1006:17)
    at Module.require (node:internal/modules/cjs/loader:1237:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (D:\repos\purple-a11y\node_modules\psl\index.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1378:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
younglim commented 5 months ago

Thanks, I have resolved the deprecation in https://github.com/GovTechSG/purple-a11y/commit/4f8518c5fe2c51a00f63fdb510c404007174887e. It will be effective in upcoming release.

brianteeman commented 5 months ago

Great news

Sabrina-a commented 1 month ago

I GOT THE SAME ISSUE IN REACT NATIVE APP ( MONO REPO USING NX):

Screenshot 2024-09-10 at 12 23 33 PM

i tried to delete the node-modules and pods and reinstall , also tried to use node v18 and v20 but i got the same issue ..that stop my app from installing the pods and run the app