{"record":{"id":"755bdd658139f4b6","repo":"swc-project/swc","slug":"unexpected-end-of-file-but-expected-or","errorCode":null,"errorMessage":"Unexpected end of file, but expected ';' or '{'","messagePattern":"Unexpected end of file, but expected ';' or '\\{'","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/syntax/mod.rs","lineNumber":177,"sourceCode":"                span: Span::new(span.lo + BytePos(1), span.hi),\n                value: at_keyword_name.0,\n                raw: Some(at_keyword_name.1),\n            })\n        };\n        let mut prelude = Vec::new();\n        let mut at_rule = AtRule {\n            span: Default::default(),\n            name,\n            prelude: None,\n            block: None,\n        };\n\n        loop {\n            // <EOF-token>\n            // This is a parse error. Return the at-rule.\n            if is!(self, EOF) {\n                if prelude.is_empty() {\n                    self.errors.push(Error::new(\n                        span!(self, span.lo),\n                        ErrorKind::EofButExpected(\"';' or '{'\"),\n                    ));\n\n                    at_rule.span = span!(self, span.lo);\n\n                    return Ok(at_rule);\n                }\n\n                at_rule.prelude = Some(Box::new(AtRulePrelude::ListOfComponentValues(\n                    self.create_locv(prelude),\n                )));\n                at_rule.span = span!(self, span.lo);\n\n                // Canonicalization against a grammar\n                if !is_dashed_ident && self.ctx.need_canonicalize {\n                    at_rule = self.canonicalize_at_rule_prelude(at_rule)?;\n                }","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/syntax/mod.rs#L159-L195","documentation":"While consuming an at-rule per the CSS syntax spec, EOF arrived where `;` or `{` was required to finish the rule; because the prelude is also empty in this path the parser raises a hard EofButExpected error. The stylesheet is truncated mid-at-rule.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/syntax/mod.rs:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Terminate the at-rule with `;` or add its { } block","Report the error from the parse result","Fix or restore the truncated stylesheet"],"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"}