Skip to content

ZNTC0300: 'import' declaration is only allowed in module code

‘import’ declaration is only allowed in module code

Category: Parser: Import/Export

import { foo } from "./bar";

Reproduce in Playground →

See the error message for cause and resolution.