Skip to content

vm: expose import phase on SourceTextModule.moduleRequests #58829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2025

Conversation

legendecas
Copy link
Member

Expose import phase on vm.SourceTextModule.moduleRequests. This deprecates vm.SourceTextModule.dependencySpecifiers as it does not expose import attributes nor import phase.

Refs: #37648

@legendecas legendecas added the vm Issues and PRs related to the vm subsystem. label Jun 25, 2025
@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++. needs-ci PRs that need a full CI run. labels Jun 25, 2025
Copy link

codecov bot commented Jun 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.08%. Comparing base (100c6da) to head (f363954).
Report is 136 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58829      +/-   ##
==========================================
- Coverage   90.10%   90.08%   -0.02%     
==========================================
  Files         640      640              
  Lines      188384   188479      +95     
  Branches    36932    36964      +32     
==========================================
+ Hits       169735   169791      +56     
- Misses      11356    11402      +46     
+ Partials     7293     7286       -7     
Files with missing lines Coverage Δ
lib/internal/vm/module.js 98.39% <100.00%> (+0.08%) ⬆️
src/module_wrap.cc 72.75% <100.00%> (+0.15%) ⬆️

... and 50 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.

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@legendecas legendecas added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jun 27, 2025
@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
node:internal/modules/esm/resolve:275
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943184073

@marco-ippolito
Copy link
Member

Commit Queue failed
node:internal/modules/esm/resolve:275
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943184073

Is commit queue broken 💀

@marco-ippolito marco-ippolito added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
node:internal/modules/esm/resolve:275
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-what/dist/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15943356431

@legendecas legendecas added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-select/lib/esm/index.js' imported from /opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/cheerio-select/lib/esm/index.js
Did you mean to import "css-select/lib/index.js"?
at finalizeResolution (node:internal/modules/esm/resolve:275:11)
at moduleResolve (node:internal/modules/esm/resolve:860:10)
at defaultResolve (node:internal/modules/esm/resolve:984:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
at ModuleJob._link (node:internal/modules/esm/module_job:137:49) {
code: 'ERR_MODULE_NOT_FOUND',
url: 'file:///opt/hostedtoolcache/node/22.16.0/x64/lib/node_modules/@node-core/utils/node_modules/css-select/lib/esm/index.js'
}

Node.js v22.16.0

https://github.com/nodejs/node/actions/runs/15945000951

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 28, 2025
@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jun 28, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 28, 2025
@nodejs-github-bot nodejs-github-bot merged commit 0f7e75f into nodejs:main Jun 28, 2025
84 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0f7e75f

@legendecas legendecas deleted the vm-modulerequests branch June 28, 2025 18:57
targos pushed a commit that referenced this pull request Jul 3, 2025
PR-URL: #58829
Refs: #37648
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
@aduh95 aduh95 added the backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. label Jul 21, 2025
@aduh95
Copy link
Contributor

aduh95 commented Jul 21, 2025

Trying to backport this to v22.x-staging causes out/Release/node test/parallel/test-vm-module-modulerequests.js to crash with node: bad option: --js-source-phase-imports. Feel free to mark it as dont-land if it's an unsolvable V8 version mismatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants