You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//module1.tsexporttypeMyModule1Type={prop1:string;}//module2.exportAll.tsexport*from'./module1.ts'//works fine//module2.exportSelectedTypes.tsexport{MyModule1TypeasMyModule2Type}from'./module1.ts'//Cannot re-export a type when the '--isolatedModules' flag is provided//module2.exportSelectedTypes.UglyWorkaround.tsimport{MyModule1Type}from'./module1.ts'exporttypeMyModule2Type=MyModule1Type//works fine
Expected behavior:
module2.exportSelectedTypes.ts compiles successfully, so we don't have to use ugly workaround
Actual behavior:
module2.exportSelectedTypes.ts causes compilation error: Cannot re-export a type when the '--isolatedModules' flag is provided
The text was updated successfully, but these errors were encountered:
We can't compile export {MyModule1Type as MyModule2Type} from './module1.ts' without knowing whether MyModule1Type is a type. If it is, we compile to nothing. If it isn't, we compile to exports.MyModule1Type = module1_1.MyModule2Type;.
The --isolatedModules flag is intended to prevent writing code that can't be transpiled without information about other modules, so it's working as intended in this case.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.6.2
Code
Expected behavior:
module2.exportSelectedTypes.ts compiles successfully, so we don't have to use ugly workaround
Actual behavior:
module2.exportSelectedTypes.ts causes compilation error:
Cannot re-export a type when the '--isolatedModules' flag is provided
The text was updated successfully, but these errors were encountered: