module: handle instantiated async module jobs in require(esm)
When require(esm) encounters a cached module job that is instantiated but not yet evaluated, run the evaluation. This catches an edge case previously missed in https://github.com/nodejs/node/pull/57187.
Fixes: https://github.com/nodejs/node/issues/58061
Review requested:
- [ ] @nodejs/loaders
- [ ] @nodejs/vm
Codecov Report
Attention: Patch coverage is 81.39535% with 8 lines in your changes missing coverage. Please review.
Project coverage is 90.21%. Comparing base (
53abd1a) to head (da4207a). Report is 117 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| lib/internal/modules/esm/module_job.js | 79.41% | 7 Missing :warning: |
| src/module_wrap.cc | 87.50% | 0 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #58067 +/- ##
=======================================
Coverage 90.20% 90.21%
=======================================
Files 630 630
Lines 186391 186423 +32
Branches 36612 36615 +3
=======================================
+ Hits 168134 168177 +43
+ Misses 11068 11061 -7
+ Partials 7189 7185 -4
| Files with missing lines | Coverage Ξ | |
|---|---|---|
| lib/internal/modules/esm/loader.js | 96.07% <100.00%> (+1.02%) |
:arrow_up: |
| src/debug_utils.h | 80.00% <ΓΈ> (ΓΈ) |
|
| src/module_wrap.h | 0.00% <ΓΈ> (ΓΈ) |
|
| src/module_wrap.cc | 72.38% <87.50%> (+0.02%) |
:arrow_up: |
| lib/internal/modules/esm/module_job.js | 97.12% <79.41%> (-1.15%) |
:arrow_down: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
CI: https://ci.nodejs.org/job/node-test-pull-request/66514/
CI: https://ci.nodejs.org/job/node-test-pull-request/66586/
CI: https://ci.nodejs.org/job/node-test-pull-request/66609/
Commit Queue failed
- Loading data for nodejs/node/pull/58067 β Done loading data for nodejs/node/pull/58067 ----------------------------------- PR info ------------------------------------ Title module: handle instantiated async module jobs in require(esm) (#58067) Author Joyee Cheung <[email protected]> (@joyeecheung) Branch joyeecheung:fix-instantiated -> nodejs:main Labels c++, lib / src, needs-ci Commits 1 - module: handle instantiated async module jobs in require(esm) Committers 1 - Joyee Cheung <[email protected]> PR-URL: https://github.com/nodejs/node/pull/58067 Fixes: https://github.com/nodejs/node/issues/58061 Reviewed-By: Jacob Smith <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/58067 Fixes: https://github.com/nodejs/node/issues/58061 Reviewed-By: Jacob Smith <[email protected]> -------------------------------------------------------------------------------- βΉ This PR was created on Tue, 29 Apr 2025 00:39:29 GMT β Approvals: 1 β - Jacob Smith (@JakobJingleheimer): https://github.com/nodejs/node/pull/58067#pullrequestreview-2802523383 β This PR needs to wait 7 more hours to land (or 0 hours if there is one more approval) β Last GitHub CI successful βΉ Last Full PR CI on 2025-05-05T10:51:08Z: https://ci.nodejs.org/job/node-test-pull-request/66609/ - Querying data for job/node-test-pull-request/66609/ β Last Jenkins CI successful -------------------------------------------------------------------------------- β Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/14841472093
Landed in e0766f9a73c5b9137bb8a92fb922c20830e76755