Skip to content

module: handle null source from async loader hooks in sync hooks#59929

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
joyeecheung:commonjs-source
Oct 14, 2025
Merged

module: handle null source from async loader hooks in sync hooks#59929
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
joyeecheung:commonjs-source

Conversation

@joyeecheung
Copy link
Copy Markdown
Member

@joyeecheung joyeecheung commented Sep 18, 2025

This relaxes the validation in sync hooks so that it accepts the quirky nullish source returned by the default step of the async loader when the module being loaded is CommonJS. When there are no customization hooks registered, a saner synchronous default load step is used to use a property instead of a reset nullish source to signify that the module should go through the CJS monkey patching routes and reduce excessive reloading from disk.

Fixes: #59384
Fixes: #57327
Refs: #59666
Refs: https://github.com/dygabo/load_module_test

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.

Projects

None yet

4 participants