-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Can't Import Ecmascript Modules via REPL #2629
Comments
(duplicate of #1285) |
Dup of #1285. This is expected. ES Module is slightly different from require as resolution is asynchronous, and could only exist in module level (e.g. in an independent file). Also see https://medium.com/the-node-js-collection/an-update-on-es6-modules-in-node-js-42c958b890c What you want is actually the dynamic |
I think currently if we really want to do this, there are only 2 solutions:
|
@kevinkassimo : I should have thought of that! |
deno: 0.10.0
v8: 7.7.37
typescript: 3.5.1
When you try to import an ecmascript module using the REPL, you get an Uncaught SyntaxError:
Node.js allows CommonJS module loading using their REPL, but I'm unable to import ES modules there either: https://stackoverflow.com/questions/56963708/.
The text was updated successfully, but these errors were encountered: