{"record":{"id":"6aada230836bfe75","repo":"swc-project/swc","slug":"duplicate-attribute","errorCode":null,"errorMessage":"Duplicate attribute","messagePattern":"Duplicate attribute","errorType":"exception","errorClass":"swc_html_parser::error::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_html_parser/src/lexer/mod.rs","lineNumber":842,"sourceCode":"                }\n                | Token::EndTag {\n                    ref mut attributes, ..\n                },\n            ) = self.current_token\n            {\n                if let Some(last) = attributes.last_mut() {\n                    let b = self.buf.clone();\n                    let mut buf = b.borrow_mut();\n                    let b = self.sub_buf.clone();\n                    let mut sub_buf = b.borrow_mut();\n\n                    let name: Atom = buf.clone().into();\n                    let raw_name = Atom::new(sub_buf.clone());\n                    let span = Span::new(attribute_start_position, self.cur_pos);\n\n                    if self.attributes_validator.contains(&name) {\n                        self.errors\n                            .push(Error::new(span, ErrorKind::DuplicateAttribute));\n                    }\n\n                    self.attributes_validator.insert(name.clone());\n\n                    last.name = name;\n                    last.raw_name = Some(raw_name);\n\n                    buf.clear();\n                    sub_buf.clear();\n\n                    last.span = span;\n                }\n            }\n        }\n    }\n\n    fn append_to_attribute_token_value(&mut self, c: Option<char>, raw_c: Option<char>) {\n        let b = self.buf.clone();","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_html_parser/src/lexer/mod.rs#L824-L860","documentation":"Tokenizer error from finish_attribute_token_name: an attribute name was completed that duplicates an attribute already present on the current start/end tag token, which HTML forbids (duplicate attribute names on one element).","triggerScenarios":"Thrown at crates/swc_html_parser/src/lexer/mod.rs:842 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or rename the duplicated attribute so names are unique on the tag","If duplicate attrs are acceptable for your pipeline, deduplicate downstream and downgrade this error"],"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"}