Skip to content

ZNTC0306: 'export' declaration must be at the top level

‘export’ declaration must be at the top level

Category: Parser: Import/Export

function f() { export const x = 1; }

Reproduce in Playground →

See the error message for cause and resolution.