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 22 #10854

Open
trombonekenny opened this issue Oct 24, 2024 · 1 comment
Open

Node 22 #10854

trombonekenny opened this issue Oct 24, 2024 · 1 comment
Labels
javascript Requires JavaScript code changes

Comments

@trombonekenny
Copy link
Contributor

For funsies, I upgraded node in my container and ran master against it. It seemed to load OK, with a warning about punycode:

bash-5.2# node --version
v22.10.0
bash-5.2# make dev
[nodemon] 3.1.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,ts,json,sql
[nodemon] starting `yarn dev:no-watch`
(node:357540) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
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:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.<anonymous> (node:internal/modules/cjs/loader:1340:12)
    at Hook._require.Module.require (/PrairieLearn/node_modules/require-in-the-middle/index.js:188:39)
    at require (node:internal/modules/helpers:141:16) {
  code: 'DEP0040'
}
info: PrairieLearn server ready, press Control-C to quit
info: Go to https://localhost:443
^C[nodemon] still waiting for 9 sub-processes to finish...
make: *** [Makefile:22: dev] Error 130

bash-5.2# npm ls punycode
prairielearn@ /PrairieLearn
+-- @prairielearn/[email protected] -> ./apps/prairielearn
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| |     `-- [email protected] deduped
| `-- [email protected]
|   `-- [email protected]
|     `-- [email protected] deduped
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected] deduped

As Node 22 transitions into ACTIVE and more dependencies update to use it, this might be easily available to us. But there's no rush. Node 20 stays in MAINTENANCE mode until mid-2026.

@trombonekenny trombonekenny added the javascript Requires JavaScript code changes label Oct 24, 2024
@nwalters512
Copy link
Contributor

npm ls punycode shows us the dependencies that are doing the right thing (using the userland alternative published to npm). Here's a more relevant command:

$ grep -E "(require|import).*punycode" --exclude "*.map" --exclude "*.min.js" --exclude "*.md" --exclude "*.d.ts" --exclude "*.html" -r node_modules
node_modules/gaxios/node_modules/whatwg-url/lib/url-state-machine.js:const punycode = require("punycode");
node_modules/psl/dist/psl.js:var Punycode = require('punycode');
node_modules/psl/index.js:var Punycode = require('punycode');
node_modules/whatwg-url/node_modules/tr46/index.js:const punycode = require("punycode/");
node_modules/oauth-signature/node_modules/uri-js/dist/esnext/schemes/mailto.js:import punycode from "punycode";
node_modules/oauth-signature/node_modules/uri-js/dist/esnext/uri.js:import punycode from "punycode";
node_modules/oauth-signature/node_modules/uri-js/src/schemes/mailto.ts:import punycode from "punycode";
node_modules/oauth-signature/node_modules/uri-js/src/uri.ts:import punycode from "punycode";
node_modules/core-js/modules/web.url.constructor.js:var toASCII = require('../internals/string-punycode-to-ascii');
node_modules/tr46/index.js:var punycode = require("punycode");
node_modules/uri-js/dist/esnext/schemes/mailto.js:import punycode from "punycode";
node_modules/uri-js/dist/esnext/uri.js:import punycode from "punycode";
node_modules/tough-cookie/lib/cookie.js:const punycode = require("punycode/");
node_modules/htmlhint/node_modules/whatwg-url/lib/url-state-machine.js:const punycode = require("punycode");
node_modules/openai/node_modules/whatwg-url/lib/url-state-machine.js:const punycode = require("punycode");
Binary file node_modules/@esbuild/darwin-arm64/bin/esbuild matches

Based on some manual investigation, there are at least two main blockers here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Requires JavaScript code changes
Projects
None yet
Development

No branches or pull requests

2 participants