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

Q: How to fix: "DeprecationWarning: punycode module is deprecated." #5061

Closed
1 task done
byteofsoren opened this issue Dec 12, 2023 · 2 comments
Closed
1 task done
Labels

Comments

@byteofsoren
Copy link

Kind of Issue

Runtime - command-line tools

Tool or Library

cspell

Version

6.31.1

Supporting Library

Not sure

OS

Linux

OS Version

Archlinux

Description

Hi.
I just wanted to test cspell on a markdown file but i got this report.

$ cspell --locale=sv your_test_file.md

(node:294824) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
CSpell: Files checked: 0, Issues found: 0 in 0 files

I tested the node trace option like below:

$ node --trace-deprecation /usr/bin/cspell --locale=en your_test_file.md

(node:297520) [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:1001:17)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/usr/lib/node_modules/cspell/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
CSpell: Files checked: 0, Issues found: 0 in 0 files

Is that some thing known or did I do something wrong?
Best regards.
/Magnus Sörensen

Steps to Reproduce

$ cspell --locale=sv your_test_file.md
$ node --trace-deprecation /usr/bin/cspell --locale=en your_test_file.md

Expected Behavior

Expected to get a warning of a spelling error or something like that.

Additional Information

No response

cspell.json

No response

cspell.config.yaml

No response

Example Repository

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Jason3S
Copy link
Collaborator

Jason3S commented Dec 12, 2023

@byteofsoren,

The warning is coming from NodeJS v21. Searching for: DeprecationWarning: The punycode module is deprecated - Google Search shows this issue popping up for a lot of tools.

Even though CSpell does not use punycode directly, it gets imported through cspell -> node-fetch -> whatwg-url -> tr46 -> punycode

There are a few options:

@Jason3S Jason3S changed the title [Bug]: DeprecationWarning: punycode module is deprecated. Q: How to fix: DeprecationWarning: punycode module is deprecated. Dec 12, 2023
@Jason3S Jason3S changed the title Q: How to fix: DeprecationWarning: punycode module is deprecated. Q: How to fix: `DeprecationWarning: punycode module is deprecated.` Dec 12, 2023
@Jason3S Jason3S changed the title Q: How to fix: `DeprecationWarning: punycode module is deprecated.` Q: How to fix: "DeprecationWarning: punycode module is deprecated." Dec 12, 2023
@Jason3S Jason3S closed this as completed Dec 18, 2023
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants