node icon indicating copy to clipboard operation
node copied to clipboard

module: handle instantiated async module jobs in require(esm)

Open joyeecheung opened this issue 7 months ago β€’ 4 comments

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

joyeecheung avatar Apr 29 '25 00:04 joyeecheung

Review requested:

  • [ ] @nodejs/loaders
  • [ ] @nodejs/vm

nodejs-github-bot avatar Apr 29 '25 00:04 nodejs-github-bot

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:

... and 22 files with indirect coverage changes

: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.

codecov[bot] avatar Apr 29 '25 01:04 codecov[bot]

CI: https://ci.nodejs.org/job/node-test-pull-request/66514/

nodejs-github-bot avatar Apr 30 '25 13:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66586/

nodejs-github-bot avatar May 04 '25 16:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66609/

nodejs-github-bot avatar May 05 '25 10:05 nodejs-github-bot

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/.ncu
https://github.com/nodejs/node/actions/runs/14841472093

nodejs-github-bot avatar May 05 '25 16:05 nodejs-github-bot

Landed in e0766f9a73c5b9137bb8a92fb922c20830e76755

nodejs-github-bot avatar May 08 '25 20:05 nodejs-github-bot