Skip to content
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

skuba node should work on .mts files in CJS projects #1733

Open
AaronMoat opened this issue Nov 12, 2024 · 1 comment
Open

skuba node should work on .mts files in CJS projects #1733

AaronMoat opened this issue Nov 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@AaronMoat
Copy link
Contributor

As a stepping stone to ESM support, this should probably work:

pnpm skuba node <my-file.mts>
Error: Transform failed with 1 error:
repo/myfile.ts:3:0: ERROR: Top-level await is currently not supported with the "cjs" output format
    at failureErrorWithLog (repo/node_modules/tsx/node_modules/esbuild/lib/main.js:1476:15)
    at repo/node_modules/tsx/node_modules/esbuild/lib/main.js:755:50
    at responseCallbacks.<computed> (repo/node_modules/tsx/node_modules/esbuild/lib/main.js:622:9)
    at handleIncomingPacket (repo/node_modules/tsx/node_modules/esbuild/lib/main.js:677:12)

Meanwhile, running tsx directly is fine (for the same file)

@AaronMoat AaronMoat added the bug Something isn't working label Nov 12, 2024
@AaronMoat
Copy link
Contributor Author

As far as I can tell this is because we're using the wrapper, added back in #341. Not sure the best way to tackle; can we effectively just call tsx {args}?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant