-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
@swc-node/register can not handle es modules #634
Comments
Although it works with node itself, you can not use dynamic imports like suggested in the error message above (async () => {
const { pkgUpSync } = await import("pkg-up");
console.log("Hello World", pkgUpSync());
})(); |
I just hit this issue too. @Brooooooklyn is there any workaround? (I can't change the code to use dynamic imports.) |
Same problem here... |
Just found this, only to see I had the same problem a year ago ... FYI: https://github.com/egoist/esbuild-register seems to not have this problem, so I'm switching to that for now. |
Here is an minimal demo of that isssue https://github.com/cschroeter/bug-swc-esmodules/blob/main/package.json
Here is how
ts-node
tackles the issue TypeStrong/ts-node#1007The text was updated successfully, but these errors were encountered: