Skip to content
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

Node v20.10 regression—requires --experimental-vm-modules when importing other modules #2

Closed
zachleat opened this issue Dec 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@zachleat
Copy link
Owner

Filed upstream: nodejs/node#51154

node:internal/modules/esm/utils:180
    throw new ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG();
          ^

TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG]: A dynamic import callback was invoked without --experimental-vm-modules
    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:180:11)
    at evalmachine.<anonymous>:3:2
    at evalmachine.<anonymous>:4:3
    at Script.runInContext (node:vm:133:12)
    at Object.runInContext (node:vm:279:6)
    at file:///Users/zachleat/Code/node-retrieve-globals/reduced-test.js:10:20
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG'
}
@zachleat zachleat added the bug Something isn't working label Dec 14, 2023
@zachleat
Copy link
Owner Author

This is also causing Eleventy CI tests to fail: https://github.com/11ty/eleventy/actions/runs/7200414704/job/19614311449

zachleat added a commit that referenced this issue Dec 14, 2023
@zachleat
Copy link
Owner Author

Workaround in place in v4.0.0

zachleat added a commit to 11ty/eleventy that referenced this issue Dec 14, 2023
@zachleat
Copy link
Owner Author

zachleat commented Dec 15, 2023

Follow up:

  • I added support for --experimental-vm-modules in v5.0.0 of this package.
  • I also added a feature test for a future in which vm.Module is stable and doesn’t require --experimental-vm-modules (some day)

632ffdd

@zachleat
Copy link
Owner Author

zachleat commented Feb 1, 2024

This was solved upstream in Node.js via nodejs/node#51244 and nodejs/node#51154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant