JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ JsBlockStatement { l_curly_token: L_CURLY@0..1 "{" [] [], statements: JsStatementList [ JsBogusStatement { items: [ IMPORT_KW@1..10 "import" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")], JsImportDefaultClause { type_token: missing (optional), default_specifier: JsDefaultImportSpecifier { local_name: JsIdentifierBinding { name_token: IDENT@10..14 "foo" [] [Whitespace(" ")], }, }, from_token: FROM_KW@14..19 "from" [] [Whitespace(" ")], source: JsModuleSource { value_token: JS_STRING_LITERAL@19..24 "\"bar\"" [] [], }, assertion: missing (optional), }, SEMICOLON@24..25 ";" [] [], ], }, ], r_curly_token: R_CURLY@25..27 "}" [Newline("\n")] [], }, ], eof_token: EOF@27..28 "" [Newline("\n")] [], } 0: JS_MODULE@0..28 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..27 0: JS_BLOCK_STATEMENT@0..27 0: L_CURLY@0..1 "{" [] [] 1: JS_STATEMENT_LIST@1..25 0: JS_BOGUS_STATEMENT@1..25 0: IMPORT_KW@1..10 "import" [Newline("\n"), Whitespace(" ")] [Whitespace(" ")] 1: JS_IMPORT_DEFAULT_CLAUSE@10..24 0: (empty) 1: JS_DEFAULT_IMPORT_SPECIFIER@10..14 0: JS_IDENTIFIER_BINDING@10..14 0: IDENT@10..14 "foo" [] [Whitespace(" ")] 2: FROM_KW@14..19 "from" [] [Whitespace(" ")] 3: JS_MODULE_SOURCE@19..24 0: JS_STRING_LITERAL@19..24 "\"bar\"" [] [] 4: (empty) 2: SEMICOLON@24..25 ";" [] [] 2: R_CURLY@25..27 "}" [Newline("\n")] [] 4: EOF@27..28 "" [Newline("\n")] [] -- import_decl_not_top_level.js:2:2 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × Illegal use of an import declaration not at the top level 1 │ { > 2 │ import foo from "bar"; │ ^^^^^^^^^^^^^^^^^^^^^^ 3 │ } 4 │ i move this declaration to the top level -- { import foo from "bar"; }