-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Using import() fails #1274
Labels
Comments
I would not mark it as a bug because we're still lacking compatibility with ESM world. I'd mark it as a feature request for the beta version |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
/cc @webpack/cli-team we need test |
WIP here - #1728 |
Close in favor #1622 |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Node 13.8.0. Using something like
import("./file.mjs")
inside a.cjs
Webpack config file or loader fails withTypeError: Invalid host defined options
error. Internally there isERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING
error. So, there are some issues with usingvm
module.The issue was found in babel-loader. Babel supports
.mjs
config files and loads them withimport()
internally, but fails to do so when launched bywebpack-cli
.What is the current behavior?
To Reproduce
asdf.mjs
:webpack.config.cjs
:Run with
webpack-cli
:Expected behavior
Executing the file with just Node works fine:
Screenshots
Please paste the results of
webpack-cli info
here, and mention other relevant informationAdditional context
Quickly fixing by adding
importModuleDynamically
tovm
invocations changes error toERR_VM_MODULE_NOT_MODULE
. Adding--experimental-vm-modules
doesn't help either. Haven't looked further.The text was updated successfully, but these errors were encountered: