-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
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 |
PR-URL: #56610 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Notable changes: crypto: * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566 fs: * (SEMVER-MINOR) allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) #56489 module: * (SEMVER-MINOR) add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) #56610 sqlite: * (SEMVER-MINOR) support TypedArray and DataView in `StatementSync` (Alex Yang) #56385 src: * (SEMVER-MINOR) add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) #56441 src,worker: * (SEMVER-MINOR) add isInternalWorker (Carlos Espa) #56469 test_runner: * (SEMVER-MINOR) add TestContext.prototype.waitFor() (Colin Ihrig) #56595 * (SEMVER-MINOR) add t.assert.fileSnapshot() (Colin Ihrig) #56459 * (SEMVER-MINOR) add assert.register() API (Colin Ihrig) #56434 PR-URL: #56800
PR-URL: #56610 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Geoffrey Booth <[email protected]> Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Notable changes: crypto: * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566 fs: * (SEMVER-MINOR) allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) #56489 module: * (SEMVER-MINOR) add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) #56610 sqlite: * (SEMVER-MINOR) support TypedArray and DataView in `StatementSync` (Alex Yang) #56385 src: * (SEMVER-MINOR) add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) #56441 src,worker: * (SEMVER-MINOR) add isInternalWorker (Carlos Espa) #56469 test_runner: * (SEMVER-MINOR) add TestContext.prototype.waitFor() (Colin Ihrig) #56595 * (SEMVER-MINOR) add t.assert.fileSnapshot() (Colin Ihrig) #56459 * (SEMVER-MINOR) add assert.register() API (Colin Ihrig) #56434 PR-URL: #56800
Notable changes: crypto: * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566 fs: * (SEMVER-MINOR) allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) #56489 module: * (SEMVER-MINOR) add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) #56610 sqlite: * (SEMVER-MINOR) support TypedArray and DataView in `StatementSync` (Alex Yang) #56385 src: * (SEMVER-MINOR) add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) #56441 src,worker: * (SEMVER-MINOR) add isInternalWorker (Carlos Espa) #56469 test_runner: * (SEMVER-MINOR) add TestContext.prototype.waitFor() (Colin Ihrig) #56595 * (SEMVER-MINOR) add t.assert.fileSnapshot() (Colin Ihrig) #56459 * (SEMVER-MINOR) add assert.register() API (Colin Ihrig) #56434 PR-URL: #56800
This new error allows user to know if its unsupported syntax like enums in strip-types or just general invalid syntax.