{"record":{"id":"193a212133642631","repo":"BookStackApp/BookStack","slug":"expected-table-cell-to-be-inside-of-table","errorCode":null,"errorMessage":"Expected table cell to be inside of table.","messagePattern":"Expected table cell to be inside of table\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts","lineNumber":115,"sourceCode":"  const node = $findMatchingParent(startingNode, (n) => $isTableRowNode(n));\n\n  if ($isTableRowNode(node)) {\n    return node;\n  }\n\n  throw new Error('Expected table cell to be inside of table row.');\n}\n\nexport function $getTableNodeFromLexicalNodeOrThrow(\n  startingNode: LexicalNode,\n): TableNode {\n  const node = $findMatchingParent(startingNode, (n) => $isTableNode(n));\n\n  if ($isTableNode(node)) {\n    return node;\n  }\n\n  throw new Error('Expected table cell to be inside of table.');\n}\n\nexport function $getTableRowIndexFromTableCellNode(\n  tableCellNode: TableCellNode,\n): number {\n  const tableRowNode = $getTableRowNodeFromTableCellNodeOrThrow(tableCellNode);\n  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableRowNode);\n  return tableNode.getChildren().findIndex((n) => n.is(tableRowNode));\n}\n\nexport function $getTableColumnIndexFromTableCellNode(\n  tableCellNode: TableCellNode,\n): number {\n  const tableRowNode = $getTableRowNodeFromTableCellNodeOrThrow(tableCellNode);\n  return tableRowNode.getChildren().findIndex((n) => n.is(tableCellNode));\n}\n\nexport type TableCellSiblings = {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/BookStackApp/BookStack/blob/18f8469a1c72f8cc8497e9372635e6dea5028071/resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts#L97-L133","documentation":"Internal invariant in $getTableNodeFromLexicalNodeOrThrow: no ancestor TableNode is found for the given node, meaning the starting node does not belong to any table. Input at fault: a LexicalNode outside of a TableNode.","triggerScenarios":"Thrown at resources/js/wysiwyg/lexical/table/LexicalTableUtils.ts:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the node passed is inside a table before requesting its TableNode","Check $isTableNode on ancestors first and skip table operations otherwise","Verify selection is not on a node that was just removed from the table"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"18f8469a1c72f8cc8497e9372635e6dea5028071","analyzedAt":"2026-09-02T19:49:33.068Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}