Skip to content

ZNTC0305: 'export' declaration is only allowed in module code

‘export’ declaration is only allowed in module code

Category: Parser: Import/Export

export const x = 1;

Reproduce in Playground →

See the error message for cause and resolution.