Commit 1fab348
authored
fix(ext/node): attach register as static on Module (#34305)
Tools like tsx do `import M from "node:module"; M.register` to decide
whether the host supports module loader hooks. The named `register`
export (a stub that returns `undefined`) was already present, but the
revert and re-land of the module loader hooks stack lost the line that
attaches it as a static on `Module`, so `M.register` came back as
`undefined`. tsx then falls through to its `registerHooks` feature
gate, which requires Node `>= 24.11.1` while Deno reports `24.2.0`, so
it throws "This version of Node.js does not support module.register()".
Re-attaching `Module.register = register;` next to`Module.registerHooks = registerHooks;` is enough to make the stub
visible again and unblocks tsx.1 parent f0ef190 commit 1fab348
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3094 | 3094 | | |
3095 | 3095 | | |
3096 | 3096 | | |
| 3097 | + | |
3097 | 3098 | | |
3098 | 3099 | | |
3099 | 3100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
113 | 127 | | |
114 | 128 | | |
115 | 129 | | |
| |||
0 commit comments