TS1066

error TS1066: In ambient enum declarations member initializer must be constant expression.

Broken Code ❌

1
2
3
4
5
enum PreKeyAuth {
INVALID = 'Invalid',
UNKNOWN = 'Unknown',
VALID = 'Valid'
}

Fixed Code ✔️

Try to replace your enum declaration with a type:

1
type PreKeyAuth = 'Invalid' | 'Unknown' | 'Valid';