-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? # to your account
Invalid JavaScript output with re-exported unresolved import types (regression) #56445
Comments
This is not a solution, but I would suggest using |
Hm, this seems tricky. I recall someone (maybe @ahejlsberg?) saying that |
Sure, there are work arounds. The best one IMO (which we are working towards) is to use |
I mean it would probably be an error under |
@dragomirtitian Yeah, I didn't mean to imply it wasn't problematic; it definitely is :) It just seemed tricky since This should definitely error under isolatedModules and I consider it a bug that it doesn't. |
Bisects to #54799. @andrewbranch |
Itβs not a missing |
Huh, it seemed weird to me that one could |
π Search Terms
export type invalid JavaScript
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
TypeScript will generate the following JS:
This JS is invalid since
SomeType
is not defined. Basically theimport type
is removed, but theexport
of the type was not.π Expected behavior
Type should be removed from export as in 5.1
Additional information about the issue
In the example above the source code has errors, so it could be argued that the output does not have to be valid. The issue was however discovered when using
transpileModule
.transpileModule
similarly can't by design resolve the types and will preserve them in the output even though the types actually exist.This is going to block us at Bloomberg from fully adopting TS 5.2 as we have workflows that depend on
transpileModule
The text was updated successfully, but these errors were encountered: