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

Node deprecation warning for Punycode #1445

Closed
aaronkyle opened this issue Jun 10, 2024 · 1 comment
Closed

Node deprecation warning for Punycode #1445

aaronkyle opened this issue Jun 10, 2024 · 1 comment

Comments

@aaronkyle
Copy link

Node.js v22.2.0 documentation lists punycode as deprecated:
https://nodejs.org/api/punycode.html

However Framework uses this package:

"punycode",

When running commands, I continually encounter this warning:

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

It would be great if we could find a way to avoid seeing this warning.

@aaronkyle aaronkyle added the bug Something isn’t working label Jun 10, 2024
@mbostock mbostock removed the bug Something isn’t working label Jun 10, 2024
@mbostock
Copy link
Member

mbostock commented Jun 10, 2024

Framework doesn’t use punycode directly. The line you linked to is a list of Node’s built-in packages and is used for resolving node imports. I traced the dependency to the psl library.

% NODE_OPTIONS="--trace-deprecation" npm exec @observablehq/[email protected] create
(node:91409) [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:1037:17)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/Users/mbostock/.npm/_npx/c018e244498e4b26/node_modules/psl/index.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)

The dependency chain is:

@observablehq/framework → jsdom@^23.2.0 → tough-cookie@^4.1.3 → psl@^1.1.33

This was fixed in lupomontero/psl#298, but a new version of psl has not been published in two years, so it’s unclear if this will be fixed anytime soon. This may also be fixed by tough-cookie in salesforce/tough-cookie#346, but it is waiting for a v5 release. It could also be fixed by JSDOM; see jsdom/jsdom#3613. At any rate, the problem is not within this library, unless we’re willing to drop the dependency on JSDOM (and we’re not currently).

@mbostock mbostock closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants