Running any script that uses the .js -> .ts fallback loader (scripts/ts-resolve-loader.js, used by benchmark, query-benchmark, incremental-benchmark, token-benchmark, and now doctor -- see #1733) prints:
(node:XXXXX) [DEP0205] DeprecationWarning: module.register() is deprecated. Use module.registerHooks() instead.
scripts/ts-resolve-loader.js calls register() from node:module:
const { register } = await import('node:module');
const hooksURL = new URL('./ts-resolve-hooks.js', import.meta.url);
register(hooksURL.href, { parentURL: import.meta.url });
module.registerHooks() is the newer synchronous, in-thread alternative (no worker thread, no async resolve/load hooks needed) added in recent Node versions. Since this repo's minimum supported Node is >=22.6 (per CLAUDE.md) / >=22.12.0 (per package.json engines), worth checking registerHooks()'s availability floor before migrating -- it may need a version gate similar to the existing --experimental-strip-types / --strip-types handling in the same file family.
Purely a deprecation warning today (still functional), not a build/test failure. Found while implementing #1733 (environment doctor), which adds another consumer of this loader.
Running any script that uses the .js -> .ts fallback loader (scripts/ts-resolve-loader.js, used by benchmark, query-benchmark, incremental-benchmark, token-benchmark, and now doctor -- see #1733) prints:
(node:XXXXX) [DEP0205] DeprecationWarning:
module.register()is deprecated. Usemodule.registerHooks()instead.scripts/ts-resolve-loader.js calls register() from node:module:
const { register } = await import('node:module');
const hooksURL = new URL('./ts-resolve-hooks.js', import.meta.url);
register(hooksURL.href, { parentURL: import.meta.url });
module.registerHooks() is the newer synchronous, in-thread alternative (no worker thread, no async resolve/load hooks needed) added in recent Node versions. Since this repo's minimum supported Node is >=22.6 (per CLAUDE.md) / >=22.12.0 (per package.json engines), worth checking registerHooks()'s availability floor before migrating -- it may need a version gate similar to the existing --experimental-strip-types / --strip-types handling in the same file family.
Purely a deprecation warning today (still functional), not a build/test failure. Found while implementing #1733 (environment doctor), which adds another consumer of this loader.