TS2430

error TS2430: Interface ‘StockExchange‘ incorrectly extends interface ‘Exchange‘.

Broken Code ❌

1
2
3
4
5
6
7
interface Exchange {
address: string;
}

export interface StockExchange extends Exchange {
address?: string;
}

Fixed Code ✔

The address in Exchange is a mandatory property but in StockExchange it is declared as being optional which
creates an incompatibility in the type. To fix the error, the property address has either to become optional or mandatory in both
declarations:

1
2
3
4
5
6
7
interface Exchange {
address: string;
}

export interface StockExchange extends Exchange {
address?: string;
}