node/lib/internal/modules/cjs
Joyee Cheung 28f468a615
module: fix sync resolve hooks for require with node: prefixes
Previously, when require()-ing builtins with the node: prefix,
the sync resolve hooks were not properly invoked, and load hooks
could not override the builtin's format. This fixes the
handling and enables redirecting prefixed built-ins to on-disk
files and overriding them with other module types via hooks.

PR-URL: https://github.com/nodejs/node/pull/61088
Fixes: https://github.com/nodejs/node/issues/60005
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-12-22 14:35:45 +00:00
..
loader.js module: fix sync resolve hooks for require with node: prefixes 2025-12-22 14:35:45 +00:00