Title: schemeless builtins crash CJS loader · Issue #58607 · nodejs/node · GitHub
Open Graph Title: schemeless builtins crash CJS loader · Issue #58607 · nodejs/node
X Title: schemeless builtins crash CJS loader · Issue #58607 · nodejs/node
Description: Version 22.15.0 Platform Darwin TK46XHNX04 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response What steps will reproduce the bug? const { registerHooks...
Open Graph Description: Version 22.15.0 Platform Darwin TK46XHNX04 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response What steps will ...
X Description: Version 22.15.0 Platform Darwin TK46XHNX04 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response What steps will ...
Opengraph URL: https://github.com/nodejs/node/issues/58607
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"schemeless builtins crash CJS loader","articleBody":"### Version\n\n22.15.0\n\n### Platform\n\n```text\nDarwin TK46XHNX04 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n```js\nconst { registerHooks } = require('node:module')\n\nregisterHooks({\n resolve: (specifier, context, nextResolve) =\u003e {\n console.log(`Resolving specifier: ${specifier}`);\n return nextResolve(specifier, context);\n },\n load: (url, context, nextLoad) =\u003e {\n console.log(`Loading URL: ${url}`);\n debugger\n return nextLoad(url, context);\n }\n})\n```\n\n```sh\nnode -r ./loader-hook.js -e \"require('node:test')\"\n```\n\n### How often does it reproduce? Is there a required condition?\n\nThis happens for all the schemeless builtins\n\n```js\nconst schemelessBlockList = new SafeSet([\n 'sea',\n 'sqlite',\n 'quic',\n 'test',\n 'test/reporters',\n]);\n```\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe resolve/loader hooks do not crash\n\n### What do you see instead?\n\n```sh\n❯ node -r ./loader-hook.js -e \"require('node:sea')\"\nResolving specifier: module\nLoading URL: node:module\nResolving specifier: node:sea\nLoading URL: sea\nnode:internal/modules/customization_hooks:276\n throw new ERR_INVALID_RETURN_PROPERTY_VALUE(\n ^\n\nTypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected a string, an ArrayBuffer, or a TypedArray to be returned for the \"source\" from the \"load\" hook but got null.\n at validateLoad (node:internal/modules/customization_hooks:276:11)\n at nextStep (node:internal/modules/customization_hooks:190:14)\n at load (/Users/revans/loader-hook.js:14:12)\n at nextStep (node:internal/modules/customization_hooks:185:26)\n at loadWithHooks (node:internal/modules/customization_hooks:348:18)\n at loadBuiltinWithHooks (node:internal/modules/cjs/loader:1164:24)\n at Function._load (node:internal/modules/cjs/loader:1216:20)\n at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)\n at Module.require (node:internal/modules/cjs/loader:1487:12) {\n code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'\n}\n\nNode.js v22.15.0\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/bizob2828","@type":"Person","name":"bizob2828"},"datePublished":"2025-06-06T17:53:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/58607/node/issues/58607"}
| 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:b8d7d736-2f39-ec4b-6b54-e49dbaadc9e8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96FE:90895:556F97:73C82C:6A4D3EE9 |
| html-safe-nonce | 20a766f79cd358eaf663963a0506e9bd327d00bc9bac5a3beccb7fc107630e66 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkZFOjkwODk1OjU1NkY5Nzo3M0M4MkM6NkE0RDNFRTkiLCJ2aXNpdG9yX2lkIjoiNzIzOTgxMzc1MDI5NDY1ODc5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 29ac1a9ddbbe3d3dafc0e8d26d44445f49e468f50a4362186a25c0e5bbceae60 |
| hovercard-subject-tag | issue:3125474371 |
| 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/58607/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d260471d466a396e1340a751c474b9274bcffeb812447c221baa7e1f5906be8/nodejs/node/issues/58607 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d260471d466a396e1340a751c474b9274bcffeb812447c221baa7e1f5906be8/nodejs/node/issues/58607 |
| og:image:alt | Version 22.15.0 Platform Darwin TK46XHNX04 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64 Subsystem No response What steps will ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bizob2828 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| 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 | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width