TS2613
Module 'add' has no default export. Did you mean to use 'import { add } from "add"' instead?
Broken Code ❌
export function add(a: number, b: number): number {
return a + b;
}import add from './add';
console.log(add(1000, 337));Fixed Code ✔️
To fix the bug we have to convert our named export into a default export:
export default function add(a: number, b: number): number {
return a + b;
}