Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified. #17

Closed
huan opened this issue Sep 3, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@huan
Copy link
Owner

huan commented Sep 3, 2021

The Problem

We need to load ESM in VM by import, but currently, we got the following error messages:

TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:34:9)
    at evalmachine.<anonymous>:2:28
    at evalmachine.<anonymous>:6:3
    at Script.runInContext (vm.js:142:18)
    at Script.runInNewContext (vm.js:147:17)
    at main (file:///home/huan/git/huan/sidecar/src/dump/t.ts:44:38) {
  code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING'
}

Related Issues

Investigation

We need to set NODE_OPTIONS=--experimental-vm-modules to enable vm.SourceTextModule.

@huan huan added the enhancement New feature or request label Sep 3, 2021
@huan
Copy link
Owner Author

huan commented Sep 4, 2021

Fixed by the commit.

huan added a commit that referenced this issue Sep 4, 2021
* ESM & TypeScript 4.4 wip

* clean & fix scripts (dist copy

* 0.13.5

* 0.15.1

* use script for cjs file

* 0.15.2

* fix unit tests

* 0.15.3

* Enable VM ESM loading for sidecar-dump util (#17)

* 0.15.4

* code clean

* fix pack testing & typo

* 0.15.5

* fix import url under windows

* 0.15.6

* use es6 for pack testing

* 0.15.7

* test

* 0.15.8

* fix windows file url path

* clean

* 0.15.9

* clean

* 0.15.10
@huan huan closed this as completed Sep 4, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant