TS2661

Cannot export 'getSdk'. Only local declarations can be exported from a module.

Broken Code ❌

index.ts
export { getSdk };
getSdk.ts
function getSdk() {}

Fixed Code ✔️

If you want to re-export getSdk in another file, you have to export it first from its origin and then import it in the file where you want to re-export it:

index.ts
import { getSdk } from './getSdk';
 
export { getSdk };
getSdk.ts
export function getSdk() {}