### Version v22.2.0 ### Platform Darwin panda.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64 ### Subsystem module ### What steps will reproduce the bug? Create the following files: `index.js` ```js const { Worker } = require("worker_threads"); new Worker("./lib/child.js", { execArgv: ["--import", "./lib/register.js"], }); ``` `lib/register.js` ```js const { register } = require("node:module"); const { pathToFileURL } = require("node:url"); register("./hooks.mjs", pathToFileURL(__filename)); ``` Then execute: `node index.js` ### How often does it reproduce? Is there a required condition? Always. ### What is the expected behavior? Why is that the expected behavior? The worker thread should start with the hooks register successfully. ### What do you see instead? The process hangs. Removing the `register` call will solve the problem. ### Additional information This problem happens due to #52706, as already triaged in #53097. An additional problem is that the suggested workaround forces people to use `node --import register.js` in order to solve the problem as the module thread is shared with Workers. While this is fine, there might be situation in which users cannot use `--import` (or `--require`). In those situation I have observed the `register` call will successfully work for subsequent dynamic `import()` call but **NOT** for `require()` (unless I missed something obvious). I created https://github.com/ShogunPanda/hooks-repro to reproduce this.