-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
module: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX #56610
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
module: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX #56610
Conversation
|
Review requested:
|
This comment was marked as outdated.
This comment was marked as outdated.
|
idk why the coverage complains, the behavioral change is tested 😫 |
|
Removed some dead code. Since we splitted compilation from execution, there is no need to check if what is thrown is not an error or if error properties have been overwritten. |
f300ebb to
f67762a
Compare
Co-authored-by: Geoffrey Booth <[email protected]>
Co-authored-by: Antoine du Hamel <[email protected]>
a3e87d4 to
b15ee51
Compare
| The provided TypeScript syntax is unsupported. | ||
| This could happen when using TypeScript syntax that requires | ||
| transformation with [type-stripping][]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be more explicit and immediately suggest to the user that a potential solution is to run using --experimental-transform-types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a more forward-looking suggestion would be to suggest they use the TS 5.8 option (once it's out) so they avoid using that syntax in the first place (or perhaps both suggestions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add it in the error message itself?
I will followup with a PR after swc updates since I have to refactor error messages anyways
|
Landed in cee63dc |
This new error allows user to know if its unsupported syntax like enums in strip-types or just general invalid syntax.