{"record":{"id":"01cd0b258618715e","repo":"swc-project/swc","slug":"unexpectedeofinstartphase","errorCode":"UnexpectedEofInStartPhase","errorMessage":"Unexpected end of file in start phase","messagePattern":"Unexpected end of file in start phase","errorType":"validation","errorClass":"swc_xml_parser::error::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_xml_parser/src/parser/mod.rs","lineNumber":288,"sourceCode":"                }\n                Token::Cdata { .. } => {\n                    self.errors.push(Error::new(\n                        token_and_info.span,\n                        ErrorKind::UnexpectedTokenInStartPhase,\n                    ));\n\n                    self.append_cdata_to_doc(token_and_info)?;\n                }\n                Token::Character { value, .. } => {\n                    if !is_whitespace(*value) {\n                        self.errors.push(Error::new(\n                            token_and_info.span,\n                            ErrorKind::UnexpectedCharacter,\n                        ));\n                    }\n                }\n                Token::Eof => {\n                    self.errors.push(Error::new(\n                        token_and_info.span,\n                        ErrorKind::UnexpectedEofInStartPhase,\n                    ));\n\n                    self.process_token(token_and_info, Some(Phase::EndPhase))?;\n                }\n                Token::Doctype { .. } => {\n                    let document_type = self.create_document_type_for_token(token_and_info);\n\n                    self.append_node(self.document.as_ref().unwrap(), document_type);\n                }\n                _ => {\n                    self.errors.push(Error::new(\n                        token_and_info.span,\n                        ErrorKind::UnexpectedTokenInStartPhase,\n                    ));\n                }\n            },","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_xml_parser/src/parser/mod.rs#L270-L306","documentation":"XML parser error in Phase::Start: an EOF token was encountered before the document element started (only whitespace, comments, PI, doctype and one root element are allowed in the start phase). Recorded on parser.errors and the document is finalized.","triggerScenarios":"Thrown at crates/swc_xml_parser/src/parser/mod.rs:288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty XML document with a root element","Check that the input was not truncated before the root element"],"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-14T00:17:10.932Z"}