-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Undocumented inability to put REPL in ES module context #32935
Comments
cc @devsnek, what's the latest on that "REPL" parse goal? |
if you mean the tc39 proposal, it's not doing anything right now. if you mean the v8 debug feature, I think they're in user feedback mode atm, not actively making anything. |
So I think where we left off with this was that when/if the REPL parse goal shipped, our REPL would use that. But if that's not advancing, should we discuss alternatives? One option that comes to mind is to just extend I tried typing |
In the short term I can try to look into enabling import declarations and import.meta in V8 replMode. I don't think --input-type should have any effect on the repl, it doesn't really make sense to call it a script or a module or anything like that. We will have to overhaul our repl in node to take advantage of replMode though (cc @BridgeAR) |
So V8 replMode is basically the “REPL parse goal” I remember you describing, where it tries to support everything at once? |
@GeoffreyBooth i don't know the exact plans of the v8 team, i posted in v8:6903 so we'll see what happens. |
The It is likely that the |
Top level await will be available as soon as V8 supports that (acorn must also support it but that should not take too long afterwards). It's independent from the |
Should we document this inability in the meantime? Hope to tackle this issue unless it's tracking something else. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There does not appear to be a way to put the REPL in ES module context.
The closest you'll get to it seems to be by running:
node --experimental-repl-await
await import('./foo.mjs')
Give it a try and you'll see that evaluating
import.meta
throws this error:I'd like this issue to discuss whether or not this limitation is presently documented somewhere or should be illuminated in https://nodejs.org/api/esm.html or elsewhere.
Note: this issue isn't about executing code with
--eval
using the--input-type=module
flag.The text was updated successfully, but these errors were encountered: