Skip to content

ZNTC0301: 'import' declaration must be at the top level

‘import’ declaration must be at the top level

Category: Parser: Import/Export

function f() { import { x } from "y"; }

Reproduce in Playground →

See the error message for cause and resolution.