TS2652

error TS2652: Merged declaration ‘MyPerson‘ cannot include a default export declaration. Consider adding a separate ‘export default MyPerson‘ declaration instead.

Broken Code ❌

1
2
3
4
5
const MyPerson = 'Benny';

export default function MyPerson() {
//
}

Fixed Code ✔️

You cannot use the same name to declare a constant and a function. If your intention is to export your constant, then do the following:

1
2
3
const MyPerson = 'Benny';

export default MyPerson;