Repository navigation
Request: Backport loader fix to v22.x #61801
Description
Activity
- changed the title
[-]Request: Backport fix to v22.x[/-][+]Request: Backport loader fix to v22.x[/+]on Feb 13, 2026 Hey, none of both pointed PR are landed in v24.x; can you please be more specific with the "solved issue"? W/out knowing what to backport, it is too hard.
According to the v24.11.1 changelog:
[[ffbc0ae60a](https://github.com/nodejs/node/commit/ffbc0ae60a)] - module: refactor and clarify async loader hook customizations (Joyee Cheung) [#60278](https://github.com/nodejs/node/pull/60278) [[6ed6062f7d](https://github.com/nodejs/node/commit/6ed6062f7d)] - module: handle null source from async loader hooks in sync hooks (Joyee Cheung) [#59929](https://github.com/nodejs/node/pull/59929)These two PRs have been merged. I've also provided a minimal reproduction if you'd like to investigate the issue directly.
I think the fix is #59929 but this would incur a behavior change in v22 - in v22,
--experimental-default-typestill existed (it was removed in v23.4.0). In a few tests, the tests for that flag checks that when--experimental-default-type=module,require.cachein not available even in CommonJS modules, which is in conflict with #59929 that tries to ensure CommonJS are handled normally (with everything as usual inrequire) when it's not being customized bymodule.register.IMO we should backport the fix and update test to test that "it's being handled by the ESM loader" differently. This would change it so that when
--experimental-default-type=module, CommonJS modules still get a normalrequireinstead of one that doesn't have many normalrequireproperties. I doubt that's going to break much, since--experimental-default-typeis an early development feature already removed in a minor release (v23.4.0) and isn't even used all that much in the wild- NOT having
require.cacheis the more surprising/breaking behavior. Putting it back is less so.
cc @nodejs/loaders @nodejs/release WDYT
Reacted by Kevin Deng and Jacob Smith- addedmoduleIssues and PRs related to the module subsystem.Issues and PRs related to the module subsystem.loadersIssues and PRs related to ES module loaders.Issues and PRs related to ES module loaders.
on Feb 25, 2026 I agree with Joyee
Backport in #62029
Reacted by Kevin Deng- linked a pull request that will close this issue[v22.x] backport module loader & loader hook fixes #62029
on Mar 3, 2026 - added 7 commits that reference this issue
on Apr 27, 2026 github-actions commented
on Jul 20, 2026 on Jul 20, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jul 20, 2026
Version
22.x
Platform
Subsystem
N/A
What steps will reproduce the bug?
I would like to request a backport of the fix that resolved an issue in v24.11.1 to the v22.x release line.
We are currently experiencing an issue that was fixed in v24.11.1. However, our project is still supporting v22.x and would benefit from having this fix backported.
How often does it reproduce? Is there a required condition?
Node.js < v24.11.1
What is the expected behavior? Why is that the expected behavior?
No errors
What do you see instead?
Additional information
Potentially Related PRs
Based on my investigation, the fix may have been introduced in one or both of these PRs:
downstream issue: rolldown/tsdown#766