TS1243

error TS1243: ‘static’ modifier cannot be used with ‘abstract’ modifier.

Solution

Bad Code ❌

1
2
3
abstract class CustomNumber {
abstract static getNumber(): number;
}

Your abstract class cannot define an abstract static function. You have to keep it static:

Fixed Code ✔️

1
2
3
4
5
abstract class CustomNumber {
static getNumber(): number {
return 1337;
};
}