Skip to content

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Aug 29, 2025

Otherwise if the ESM happens to be cached separately by the ESM loader before it gets loaded with require(esm) from within an imported CJS file (which uses a re-invented require() with a couple of quirks, including a separate cache), it won't be able to load the esm properly from the cache.

Refs: #59666
Refs: #57327 (comment)
Refs: #52697

Otherwise if the ESM happens to be cached separately by the ESM loader
before it gets loaded with `require(esm)` from within an imported
CJS file (which uses a re-invented require() with a couple of quirks,
including a separate cache), it won't be able to load the esm properly
from the cache.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/vm

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Aug 29, 2025
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 97.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.90%. Comparing base (bcb802c) to head (ad5e7b9).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/modules/esm/translators.js 90.62% 3 Missing ⚠️
src/module_wrap.cc 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59679      +/-   ##
==========================================
- Coverage   89.91%   89.90%   -0.01%     
==========================================
  Files         667      667              
  Lines      196600   196926     +326     
  Branches    38601    38658      +57     
==========================================
+ Hits       176780   177055     +275     
- Misses      12269    12310      +41     
- Partials     7551     7561      +10     
Files with missing lines Coverage Δ
lib/internal/modules/cjs/loader.js 97.58% <100.00%> (-0.08%) ⬇️
lib/internal/modules/esm/loader.js 96.18% <100.00%> (+0.06%) ⬆️
src/module_wrap.cc 74.75% <80.00%> (-0.56%) ⬇️
lib/internal/modules/esm/translators.js 92.28% <90.62%> (-0.13%) ⬇️

... and 47 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. 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
Development

Successfully merging this pull request may close these issues.

3 participants