swc-project/swc · error · Error
No table row to close
Error message
No table row to close
What it means
HTML parse error on a </tr> (or row-closing) end tag: the stack of open elements has no tr element in table scope, so there is no table row to close. The error is recorded and the end tag is ignored per spec.
Source
Thrown at crates/swc_html_parser/src/parser/mod.rs:5393
self.insert_html_element(token_and_info)?;
self.insertion_mode = InsertionMode::InCell;
self.active_formatting_elements.insert_marker();
maybe_allow_self_closing!(is_self_closing, tag_name);
}
// An end tag whose tag name is "tr"
//
// If the stack of open elements does not have a tr element in table scope, this
// is a parse error; ignore the token.
//
// Otherwise:
//
// Clear the stack back to a table row context. (See below.)
//
// Pop the current node (which will be a tr element) from the stack of open
// elements. Switch the insertion mode to "in table body".
Token::EndTag { tag_name, .. } if tag_name == "tr" => {
if !self.open_elements_stack.has_in_table_scope("tr") {
self.errors.push(Error::new(
token_and_info.span,
ErrorKind::NoTableRowToClose,
));
} else {
self.open_elements_stack.clear_back_to_table_row_context();
self.update_end_tag_span(
self.open_elements_stack.items.last(),
token_and_info.span,
);
self.open_elements_stack.pop();
self.insertion_mode = InsertionMode::InTableBody;
}
}
// A start tag whose tag name is one of: "caption", "col", "colgroup", "tbody",
// "tfoot", "thead", "tr"
//
// An end tag whose tag name is "table"
//View on GitHub (pinned to 5176682b65)
Solutions
- Remove the stray </tr>
- Add the missing <tr> start tag so the row exists in table scope
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/swc_html_parser/src/parser/mod.rs:5393 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of swc-project/swc@5176682b65 (2026-08-17).
Data as JSON: /api/errors/1c700f9adccec3dc.
Report an issue: GitHub.