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
Wrong error when using no type while declaring constant in repl #1563
Comments
Looks like tsconfig "module: esnext" is the culprit.
…On Thu, Dec 9, 2021, 2:35 AM Dragonizedpizza ***@***.***> wrote:
Search Terms Expected Behavior
undefined/nothing.
Actual Behavior
/home/arch/Desktop/Hurricano/<repl>.ts:3
export {};
^^^^^^
Uncaught SyntaxError: Unexpected token 'export'
Steps to reproduce the problem
1. Make a ts-node repl.
2. Type in const h = {};
Minimal reproduction
[image: image]
<https://user-images.githubusercontent.com/70718540/145353218-307cbee3-c105-466d-8ebd-14a5987f1a4f.png>
Specifications
- ts-node v10.4.0
- node v16.13.0
- compiler v4.5.2
tsconfig.json, if you're using one:
https://srcb.in/ldUTwVZaod
- Operating system and version:
- Garuda Linux Soaring.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1563>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OHR2NQUVUQLEBAFLW3UQBL4BANCNFSM5JVX33CA>
.
|
Ok |
I assume this has been resolved. If not, feel free to reply and we can re-open. |
So this happens with Like shouldn't the repl mode always compile the code given as CommonJS/script regardless of the |
Yeah, I think the bug here is that we don't force the repl to be CJS even in ESM projects. I thought I already had a ticket for this; can you check for one and, if not found, file a new bug report? |
I think this is #1752 |
Thanks, I added a comment on that issue about a couple possible ways to fix it. |
Search Terms
Expected Behavior
undefined/nothing.
Actual Behavior
Steps to reproduce the problem
const h = {};
Minimal reproduction
Specifications
tsconfig.json, if you're using one:
https://srcb.in/ldUTwVZaod
The text was updated successfully, but these errors were encountered: