{"record":{"id":"3ba627235507062a","repo":"swc-project/swc","slug":"no-tag-name-element-in-scope-but-a-tag-name","errorCode":null,"errorMessage":"No \"{tag_name}\" element in scope but a \"{tag_name}\" end tag seen","messagePattern":"No \"(.+?)\" element in scope but a \"(.+?)\" end tag seen","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_html_parser/src/parser/mod.rs","lineNumber":3324,"sourceCode":"                            }\n\n                            let popped = self\n                                .open_elements_stack\n                                .pop_until_tag_name_popped(&[\"form\"]);\n\n                            self.update_end_tag_span(popped.as_ref(), token_and_info.span);\n                        }\n                    }\n                    // An end tag whose tag name is \"p\"\n                    //\n                    // If the stack of open elements does not have a p element in button scope, then\n                    // this is a parse error; insert an HTML element for a \"p\" start tag token with\n                    // no attributes.\n                    //\n                    // Close a p element.\n                    Token::EndTag { tag_name, .. } if tag_name == \"p\" => {\n                        if !self.open_elements_stack.has_in_button_scope(\"p\") {\n                            self.errors.push(Error::new(\n                                token_and_info.span,\n                                ErrorKind::NoElementToCloseButEndTagSeen(tag_name.clone()),\n                            ));\n\n                            self.insert_html_element(\n                                &self.create_fake_token_and_info(\"p\", Some(token_and_info.span)),\n                            )?;\n                        }\n\n                        self.close_p_element(token_and_info, true);\n                    }\n                    // An end tag whose tag name is \"li\"\n                    //\n                    // If the stack of open elements does not have an li element in list item scope,\n                    // then this is a parse error; ignore the token.\n                    //\n                    // Otherwise, run these steps:\n                    //","sourceCodeStart":3306,"sourceCodeEnd":3342,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_html_parser/src/parser/mod.rs#L3306-L3342","documentation":"HTML parse error: an end tag (e.g. </form> or </p>-class tags) was seen but no corresponding element exists in the required scope on the stack of open elements, so there is nothing to close. The tag name is embedded in the message; recovery follows the spec (ignore or synthesize the element).","triggerScenarios":"Thrown at crates/swc_html_parser/src/parser/mod.rs:3324 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the stray end tag","Add the matching start tag or fix earlier structure so the element is in scope"],"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"}