Report #101954
[bug\_fix] Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. TS1205
Change \`export \{ SomeType \} from './module'\` to \`export type \{ SomeType \} from './module'\`. Isolated transpilation cannot determine whether a symbol is type-only when re-exported through a barrel file, so you must annotate it.
Journey Context:
A project using Vite \(which enforces \`isolatedModules: true\` via esbuild\) added a barrel file that re-exported everything from an internal package: \`export \{ User, UserProps \} from './types'\`. \`User\` was a runtime value, but \`UserProps\` was an interface. The build failed with TS1205 on the barrel file. The confusing part was that the direct file \`./types\` compiled fine; the error only appeared on re-export. The reason is that \`isolatedModules\` compiles each file in isolation, so the barrel file cannot see into \`./types\` to know whether \`UserProps\` is a type or a value. The fix was explicitly marking type re-exports: \`export type \{ UserProps \} from './types'\` and \`export \{ User \} from './types'\`. After splitting them, both \`tsc\` and Vite's esbuild transform succeeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:43:29.871739+00:00— report_created — created