René's URL Explorer Experiment


Title: modules: fix sync hook short-circuit in require() in imported CJS by joyeecheung · Pull Request #62920 · nodejs/node · GitHub

Open Graph Title: modules: fix sync hook short-circuit in require() in imported CJS by joyeecheung · Pull Request #62920 · nodejs/node

X Title: modules: fix sync hook short-circuit in require() in imported CJS by joyeecheung · Pull Request #62920 · nodejs/node

Description: For imported CJS, if it's not customized by asynchronous hooks, make sure it won't use the quirky re-invented require in all cases. When the imported CJS module is customized by synchronous hooks, in the synthetic module evalutation step, avoid calling the respective default step again. Make the branching of loadCJSModuleWithModuleLoad() and loadCJSModuleWithSpecialRequire() more explicit, and fold the tentative fs read in the 'commonjs' translator into the share createCJSModuleWrap() helper instead of checking it twice in the same path. Refs: #55808 (comment) Fixes: #63060

Open Graph Description: For imported CJS, if it's not customized by asynchronous hooks, make sure it won't use the quirky re-invented require in all cases. When the imported CJS module is customized by synchronous...

X Description: For imported CJS, if it's not customized by asynchronous hooks, make sure it won't use the quirky re-invented require in all cases. When the imported CJS module is customized by syn...

Opengraph URL: https://github.com/nodejs/node/pull/62920

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/commits/:range(.:format)
route-controllerpull_requests
route-actioncommits
fetch-noncev2:3c741580-8816-a7f5-9222-11d9e6229e99
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id98CA:3133FE:6342FFD:6663F57:6A655A77
html-safe-nonce3c925de357ce809ac805652c9b7aa46836ce722ab2992a36c4cb86593808fc3b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OENBOjMxMzNGRTo2MzQyRkZEOjY2NjNGNTc6NkE2NTVBNzciLCJ2aXNpdG9yX2lkIjoiODkwMDY5MTc4MTM0NjQ4MjgwNyIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9
visitor-hmac8048e33957c8fe2d169bd89923a496d21cfec4587f2d7a6ef44f3e77b939404f
hovercard-subject-tagpull_request:3575887477
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/commits
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
twitter:imagehttps://avatars.githubusercontent.com/u/4299420?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4299420?s=400&v=4
og:image:altFor imported CJS, if it's not customized by asynchronous hooks, make sure it won't use the quirky re-invented require in all cases. When the imported CJS module is customized by synchronous...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release309153364422b3c499922d1a2a6404910a58ed8e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F62920%2Fcommits%2F539c680cdb03131e75fad614fe30ffb6707e7934
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F62920%2Fcommits%2F539c680cdb03131e75fad614fe30ffb6707e7934
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Fcommits&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Reloadhttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Reloadhttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36.1k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.3k https://github.com/nodejs/node/issues
Pull requests 1.1k https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
nodejs-github-bothttps://github.com/nodejs-github-bot
nodejs:mainhttps://github.com/nodejs/node/tree/main
joyeecheung:fix-hookshttps://github.com/joyeecheung/node/tree/fix-hooks
Conversation 18 https://github.com/nodejs/node/pull/62920
Commits 1 https://github.com/nodejs/node/pull/62920/commits
Checks 39 https://github.com/nodejs/node/pull/62920/checks
Files changed https://github.com/nodejs/node/pull/62920/files
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
modules: fix sync hook short-circuit in require() in imported CJS https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#top
Show all changes 1 commit https://github.com/nodejs/node/pull/62920/files
539c680 module: fix sync hook short-circuit in require() in imported CJS joyeecheung Apr 18, 2026 https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Clear filters https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
loader.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
load.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
loader.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
translators.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-b1de5e9ce1e9b411001c63d11a5092dbba32e1586269a20dc11408375eb2f16c
mock.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-87fe4fbfd23996c49072c2fb88829aaa0ed1be188b9da9d072471b0a523cd1c8
test-module-hooks-load-import-cjs-custom-source.js https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-ac0dbc49d4a2c7d491af7110e207d87839b80669c9ea4d717e7f74d65c876668
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
https://github.com/joyeecheung
joyeecheunghttps://github.com/nodejs/node/commits?author=joyeecheung
lib/internal/modules/cjs/loader.jshttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
View file https://github.com/joyeecheung/node/blob/539c680cdb03131e75fad614fe30ffb6707e7934/lib/internal/modules/cjs/loader.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/62920/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-5b5902273122e094ff474fda358605ffa45a4a58b51cd0bf4c1acb93779df142
lib/internal/modules/esm/load.jshttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
View file https://github.com/joyeecheung/node/blob/539c680cdb03131e75fad614fe30ffb6707e7934/lib/internal/modules/esm/load.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/62920/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-bdab80c290d22162f748d1a80a5a2a5211460e5ab3fca7a42af0e8ca128e316d
lib/internal/modules/esm/loader.jshttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
View file https://github.com/joyeecheung/node/blob/539c680cdb03131e75fad614fe30ffb6707e7934/lib/internal/modules/esm/loader.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/62920/commits/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
https://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934#diff-f6796082f599554ec3a29c47cf026cb24fc5104884f2632e472c05fe622d778b
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
Please reload this pagehttps://github.com/nodejs/node/pull/62920/commits/539c680cdb03131e75fad614fe30ffb6707e7934
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.