-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.
Description
- Version: 13.2.0
- Platform: macOS
- Subsystem: modules
$ node --input-type=module -p "import('fs')"
Promise {
<rejected> TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.
[...] {
code: 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING'
}
}
$ node -e "import('fs')"
(node:41604) UnhandledPromiseRejectionWarning: TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:35:9)
$ node --input-type=module -e "import 'path'; import('fs')"
(node:42773) UnhandledPromiseRejectionWarning: TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.
The last one seems the most confusing: The same input string works fine with static import but not with dynamic import from the same file. I assume this is a side-effect of tying the import callback to individual scripts instead of to the context.
Metadata
Metadata
Assignees
Labels
cliIssues and PRs related to the Node.js command line interface.Issues and PRs related to the Node.js command line interface.esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.