bun
bun copied to clipboard
Re-exporting typescript types generates syntax errors
What version of Bun is running?
0.5.0
What platform is your computer?
Xubuntu 22.10 x86-64 Linux-5.19.0-29-generic-x86_64-with-glibc2.36
What steps can reproduce the bug?
- Create file
IFoo.ts:
export interface IFoo {
bar: number;
}
export class Foo {};
- Create file
IFooRexport.ts:
export { Foo, IFoo } from "./IFoo";
- Create file
main.ts:
import { Foo } from "./IFooReexport";
new Foo();
- Execute
main.ts:
bun main.ts
What is the expected behaviour?
The script executes without any errors.
What do you see instead?
The script returns exit code 1 with the following error:
SyntaxError: Indirectly exported binding name 'IFoo' is not found.
Additional information
Compiling main.ts with tsc doesn't throw any errors.
As a temporary workaround, try export type { IFoo }
That seems to work, thank you!
Duplicate of #5426