TS1294
This syntax is not allowed when 'erasableSyntaxOnly' is enabled.
Broken Code ❌
export enum CancelOrderPeriod {
ONE_DAY = 'day',
ONE_HOUR = 'hour',
ONE_MINUTE = 'min',
}Fixed Code ✔️
Erasable syntax refers to features that TypeScript introduces to the language but can be easily removed or "erased" during the compilation process to JavaScript.
Enums cannot be easily translated into JavaScript and are not allowed when the compiler flag erasableSyntaxOnly is enabled. Instead, you would need to use a readonly object to replicate an enumeration:
export const CancelOrderPeriod = {
ONE_DAY: 'day',
ONE_HOUR: 'hour',
ONE_MINUTE: 'min',
} as const;