Repository navigation
fix(ext/node): don't expose Module.register stub - #34894
Merged
Merged
Conversation
Revert #34305, which attached the no-op register stub as a static on Module. Tools probe Module.register to decide whether to use the out-of-thread ESM loader; with the stub present they set up the loader and wait on a MessagePort handshake the stub never answers, hanging silently. The version bump in #34804 (emulated Node v24.15.0) clears tsx's >= 24.11.1 gate so it uses registerHooks instead, making the stub unnecessary. Closes #34868
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Playwright (and other tools) silently exit on Deno 2.8.x instead of
running, because they feature-probe
import M from "node:module"; M.registerto decide whether to install an out-of-thread ESM loader.PR #34305 attached our
registerstub as a static onModuletounblock tsx, but the stub is a no-op: it never imports the loader and
never runs its
initialize({ port }). Tools that take themodule.register()path thenawaitaMessagePortround-trip thatnothing ever answers, so the event loop drains with the promise pending
and the process exits 0 with no output.
The original reason #34305 was needed no longer holds. tsx only fell
back to
registerbecause itsregisterHooksfeature gate requiresNode >= 24.11.1 while Deno reported 24.2.0. The emulated Node version
bump to v24.15.0 in #34804 clears that gate, so tsx now uses
module.registerHooks(which we do implement) and no longer touches thestub. This reverts #34305 so
Module.registeris absent again:Playwright skips the loader and works, and tsx takes the working
registerHookspath.Closes #34868