-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
await import() doesn't work in REPL even with --experimental-repl-await #20578
Comments
Interestingly Chrome itself has the exact same issue - https://bugs.chromium.org/p/chromium/issues/detail?id=807528. |
it's worth noting that currently import() doesn't work in repl anyway. there is a pr open to fix that but it hasn't landed yet. |
@jdalton could you share the link to your branch / work here further? |
@guybedford Sure! For the parse-side (so non-dynamic-import base url issues) I have acorn extensions and customizations handled in a repo (here - MIT licensed). When compiled into Node I update the Acorn parser references to improve parsing. There is still some tweaks to do to the AST transforms done by the
By this I mean updating the transform to handle statements a bit better.
would error because the transform will fail (falling back to the untransformed literal code).
and static The improved parsing bit is just adding Acorn parsing support for things like dynamic I also have a toolbox of fast-paths/optimization techniques for Acorn to make things snappy. This is all a balance between how much tinkering with Acorn is wanted vs. waiting on a standardized top-level |
@jdalton thanks, that helps a lot to get context into the issue here. |
Duplicate of #19570 ? |
No, #19570 is about |
Ah, that's because Acorn doesn't implement dynamic |
@TimothyGu I covered this in the comment above. |
This seems to be working now in Node 13 with |
await import()
doesn't work in the REPL even with--experimental-repl-await
:I can verify that dynamic import by itself works in the REPL, it's only the
await
that's an issue:The text was updated successfully, but these errors were encountered: