{"record":{"id":"512e2143600f432e","repo":"typst/typst","slug":"cannot-place-a-grid-header-within-another-header-o","errorCode":null,"errorMessage":"cannot place a grid header within another header or footer","messagePattern":"cannot place a grid header within another header or footer","errorType":"validation","errorClass":"HintedString","httpStatus":null,"severity":"error","filePath":"crates/typst-library/src/layout/grid/mod.rs","lineNumber":532,"sourceCode":"}\n\ncast! {\n    GridItem,\n    self => match self {\n        Self::HLine(hline) => hline.into_value(),\n        Self::VLine(vline) => vline.into_value(),\n        Self::Cell(cell) => cell.into_value(),\n    },\n    v: Content => {\n        v.try_into()?\n    }\n}\n\nimpl TryFrom<Content> for GridItem {\n    type Error = HintedString;\n    fn try_from(value: Content) -> HintedStrResult<Self> {\n        if value.is::<GridHeader>() {\n            bail!(\"cannot place a grid header within another header or footer\");\n        }\n        if value.is::<TableHeader>() {\n            bail!(\"cannot place a table header within another header or footer\");\n        }\n        if value.is::<GridFooter>() {\n            bail!(\"cannot place a grid footer within another footer or header\");\n        }\n        if value.is::<TableFooter>() {\n            bail!(\"cannot place a table footer within another footer or header\");\n        }\n        if value.is::<TableCell>() {\n            bail!(\n                \"cannot use `table.cell` as a grid cell\";\n                hint: \"use `grid.cell` instead\";\n            );\n        }\n        if value.is::<TableHLine>() {\n            bail!(","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-library/src/layout/grid/mod.rs#L514-L550","documentation":"Raised while converting content into a GridItem: a `grid.header` was nested inside another header or footer. Headers and footers can only contain cells and lines, not other repeating groups.","triggerScenarios":"Thrown at crates/typst-library/src/layout/grid/mod.rs:532 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the inner `grid.header` to the top level of the grid's children","Restrict the header's contents to cells, `grid.hline`, and `grid.vline`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}