{"record":{"id":"05454200ab3719c2","repo":"TanStack/table","slug":"getrow-could-not-find-row-with-id-rowid","errorCode":null,"errorMessage":"getRow could not find row with ID: ${rowId}","messagePattern":"getRow could not find row with ID: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/table-core/src/core/rows/coreRowsFeature.utils.ts","lineNumber":352,"sourceCode":" * ```\n */\nexport function table_getRow<\n  TFeatures extends TableFeatures,\n  TData extends RowData,\n>(\n  table: Table_Internal<TFeatures, TData>,\n  rowId: string,\n  searchAll?: boolean,\n): Row<TFeatures, TData> {\n  // TODO - simplify this across different row models\n  let row = (searchAll ? table.getPrePaginatedRowModel() : table.getRowModel())\n    .rowsById[rowId]\n\n  if (!row) {\n    row = table.getCoreRowModel().rowsById[rowId]\n    if (!row) {\n      if (process.env.NODE_ENV === 'development') {\n        throw new Error(`getRow could not find row with ID: ${rowId}`)\n      }\n      throw new Error()\n    }\n  }\n\n  return row\n}\n","sourceCodeStart":334,"sourceCodeEnd":360,"githubUrl":"https://github.com/TanStack/table/blob/d01c01bedbab0ff6c2641f18b2fc9a11545d9bf6/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L334-L360","documentation":"table.getRow(rowId) looks the row up in the (grouped/expanded) row model's rowsById, falling back to the core row model. If the ID exists in neither, the library throws this dev-mode error. Row IDs are generated from row id keys and grouping/expansion paths, so a lookup with an unknown ID fails.","triggerScenarios":"Calling table.getRow('someId') where 'someId' is not a key in the current row model's rowsById nor the core row model — e.g. stale ID after data change, wrong row id key, or an ID including grouping/expansion path segments that no longer exist.","commonSituations":"Storing row IDs across renders while data is refetched/filtered; expanding/grouping changes generated IDs; passing user-supplied IDs; using getRow in click handlers after rows were removed.","solutions":["Check the row exists before calling getRow (e.g. inspect table.getRowModel().rowsById or table.getCoreRowModel().rowsById).","Regenerate the row ID from the current row object instead of caching an old ID.","Verify the row id resolution (getValueForKey / getRowId option) matches what you use to build IDs.","Catch the error in production: in production builds the same condition throws a bare Error without the message."],"exampleFix":"// before\nconst row = table.getRow(rowId)\n// after\nconst row = table.getCoreRowModel().rowsById[rowId] ?? table.getRowModel().rowsById[rowId]\nif (!row) return // or show fallback UI","handlingStrategy":"validation","validationCode":"function findRowSafe(table, rowId) {\n  return table.getRowModel().rowsById[rowId] ?? table.getCoreRowModel().rowsById[rowId] ?? null\n}\n// before calling table.getRow(rowId): const row = findRowSafe(table, rowId); if (!row) return","typeGuard":"function rowExists(table: Table<any>, rowId: string): boolean {\n  return rowId in table.getRowModel().rowsById || rowId in table.getCoreRowModel().rowsById\n}","tryCatchPattern":"try {\n  const row = table.getRow(rowId)\n  // use row\n} catch {\n  // row not found: show fallback / refresh data\n}","preventionTips":["Never cache row IDs across data refetches; derive them from the current row","Confirm getRowId/row id key produces the IDs you look up","Remember grouping/expansion changes generated row IDs","Check rowsById before calling getRow"],"tags":["rows","lookup","state-consistency"],"backgroundTag":"row-id-not-found","analyzedSha":"d01c01bedbab0ff6c2641f18b2fc9a11545d9bf6","analyzedAt":"2026-08-28T21:52:44.679Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}