Skip to content

fix(ext/node): don't expose Module.register stub - #34894

Merged
bartlomieju merged 1 commit into
mainfrom
fix/revert-module-register-static
Jun 5, 2026
Merged

bartlomieju merged 1 commit into
mainfrom
fix/revert-module-register-static

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Playwright (and other tools) silently exit on Deno 2.8.x instead of
running, because they feature-probe import M from "node:module"; M.register to decide whether to install an out-of-thread ESM loader.
PR #34305 attached our register stub as a static on Module to
unblock tsx, but the stub is a no-op: it never imports the loader and
never runs its initialize({ port }). Tools that take the
module.register() path then await a MessagePort round-trip that
nothing 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 register because its registerHooks feature gate requires
Node >= 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 the
stub. This reverts #34305 so Module.register is absent again:
Playwright skips the loader and works, and tsx takes the working
registerHooks path.

Closes #34868

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
@bartlomieju
bartlomieju enabled auto-merge (squash) June 5, 2026 07:43
@bartlomieju
bartlomieju merged commit bb80cf8 into main Jun 5, 2026
268 of 270 checks passed
@bartlomieju
bartlomieju deleted the fix/revert-module-register-static branch June 5, 2026 11:49
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

Successfully merging this pull request may close these issues.

Deno 2.8.x running Playwright silently fails, possibly due to node:module.register() incompatibility

1 participant