{"record":{"id":"949d4ff414678b4d","repo":"swc-project/swc","slug":"unexpected-token-949d4f","errorCode":null,"errorMessage":"Unexpected token","messagePattern":"Unexpected token","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/syntax/mod.rs","lineNumber":441,"sourceCode":"                    let state = self.input.state();\n                    let qualified_rule = self\n                        .with_ctx(Ctx {\n                            block_contents_grammar: BlockContentsGrammar::StyleBlock,\n                            mixed_with_declarations: true,\n                            ..self.ctx\n                        })\n                        .parse_as::<Box<QualifiedRule>>();\n\n                    match qualified_rule {\n                        Ok(i) => rules.push(StyleBlock::QualifiedRule(i)),\n                        Err(err) => {\n                            self.errors.push(err);\n                            self.input.reset(&state);\n\n                            let span = self.input.cur_span();\n\n                            self.errors\n                                .push(Error::new(span, ErrorKind::Unexpected(\"token\")));\n\n                            // For recovery mode\n                            let mut list_of_component_values = ListOfComponentValues {\n                                span: Default::default(),\n                                children: Vec::new(),\n                            };\n\n                            while !is_one_of!(self, \";\", EOF) {\n                                let component_value = self.parse_as::<ComponentValue>()?;\n\n                                list_of_component_values.children.push(component_value);\n                            }\n\n                            list_of_component_values.span = span!(self, span.lo);\n\n                            declarations.push(StyleBlock::ListOfComponentValues(Box::new(\n                                list_of_component_values,\n                            )));","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/syntax/mod.rs#L423-L459","documentation":"While parsing a style block's rule list, a QualifiedRule failed to parse; recovery pushes this error into self.errors and skips tokens to continue. 'Unexpected token' marks input at that position that the rule grammar cannot accept.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/syntax/mod.rs:441 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the collected errors to locate the offending token","Fix the selector/rule syntax in the style block","Use the recovery results to skip and keep parsing the rest of the sheet"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}