Title: Incorrect `parentURL` for `registerHooks` when using `require(esm)` · Issue #60973 · nodejs/node · GitHub
Open Graph Title: Incorrect `parentURL` for `registerHooks` when using `require(esm)` · Issue #60973 · nodejs/node
X Title: Incorrect `parentURL` for `registerHooks` when using `require(esm)` · Issue #60973 · nodejs/node
Description: Version v25.2.1 Platform Darwin Kevins-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response What steps will reproduce the bug? Reproduc...
Open Graph Description: Version v25.2.1 Platform Darwin Kevins-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response Wha...
X Description: Version v25.2.1 Platform Darwin Kevins-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response Wha...
Opengraph URL: https://github.com/nodejs/node/issues/60973
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect `parentURL` for `registerHooks` when using `require(esm)`","articleBody":"### Version\n\nv25.2.1\n\n### Platform\n\n```text\nDarwin Kevins-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\nReproduction: https://github.com/sxzz/node-loader-require-esm\n\n### How often does it reproduce? Is there a required condition?\n\nN/A\n\n### What is the expected behavior? Why is that the expected behavior?\n\nExpected: The `parentURL` of `require(esm)` should include the query `?test`, matching the value of `import.meta.url`.\n```\n{\n specifier: './esm.mjs',\n url: 'file:///x/node-loader-require-esm/esm.mjs',\n parent: 'file:///x/node-loader-require-esm/mod.mjs?test'\n}\n```\nActual:\n```\n{\n specifier: './esm.mjs',\n url: 'file:///x/node-loader-require-esm/esm.mjs',\n parent: 'file:///x/node-loader-require-esm/mod.mjs'\n}\n```\n\n### What do you see instead?\n\n```\n{\n specifier: './mod.mjs?test',\n url: 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/mod.mjs?test',\n parent: 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/main.mjs'\n}\n{\n specifier: 'node:module',\n url: 'node:module',\n parent: 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/mod.mjs?test' // ✅\n}\n{\n 'import.meta.url': 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/mod.mjs?test'\n}\n{\n specifier: './esm.mjs',\n url: 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/esm.mjs',\n parent: 'file:///Users/kevin/Developer/reproduction/node-loader-require-esm/mod.mjs' // ❌\n}\n```\n\n### Additional information\n\nhttps://github.com/sxzz/import-without-cache needs this behavior.\n\n/cc @joyeecheung ","author":{"url":"https://github.com/sxzz","@type":"Person","name":"sxzz"},"datePublished":"2025-12-06T02:21:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/60973/node/issues/60973"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2e9ecb42-455b-215c-6a1e-5c31adf1986b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9748:8F4AB:134D7AA:1AE463F:6A4BFC47 |
| html-safe-nonce | 009c72092e08e6294655c85e38c2592e8b07db069d7eaf31eb8b089ee6ba2fc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzQ4OjhGNEFCOjEzNEQ3QUE6MUFFNDYzRjo2QTRCRkM0NyIsInZpc2l0b3JfaWQiOiIyMDQyODIzMjk4MzAzOTE3MTI3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 88f464727f1bb52a1b0525952185f3b2c01017c24027c26b192ee6b1457ead87 |
| hovercard-subject-tag | issue:3700862555 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/60973/issue_layout |
| twitter:image | https://opengraph.githubassets.com/922c8faf2a3163b16e089f97e5ed950259633244083f272b512164aecd7aea5e/nodejs/node/issues/60973 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/922c8faf2a3163b16e089f97e5ed950259633244083f272b512164aecd7aea5e/nodejs/node/issues/60973 |
| og:image:alt | Version v25.2.1 Platform Darwin Kevins-MacBook-Pro.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response Wha... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sxzz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0f5d3ba365b3985d75c32a5957c8635488d58dcf027ae6ae958eee7edaa306a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6c542436f9c7282f518e9ec7bc5a3adff20a13fd |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width