{"record":{"id":"89d5be8751f134be","repo":"angular/components","slug":"could-not-find-column-with-id-columnid","errorCode":null,"errorMessage":"Could not find column with id \"${columnId}\".","messagePattern":"Could not find column with id \"(.+?)\"\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cdk/table/table.ts","lineNumber":1419,"sourceCode":"      if (this.multiTemplateDataRows) {\n        context.dataIndex = this._renderRows[renderIndex].dataIndex;\n        context.renderIndex = renderIndex;\n      } else {\n        context.index = this._renderRows[renderIndex].dataIndex;\n      }\n    }\n  }\n\n  /** Gets the column definitions for the provided row def. */\n  private _getCellTemplates(rowDef: BaseRowDef): TemplateRef<any>[] {\n    if (!rowDef || !rowDef.columns) {\n      return [];\n    }\n    return Array.from(rowDef.columns, columnId => {\n      const column = this._columnDefsByName.get(columnId);\n\n      if (!column) {\n        throw getTableUnknownColumnError(columnId);\n      }\n\n      return rowDef.extractCellTemplate(column);\n    });\n  }\n\n  /**\n   * Forces a re-render of the data rows. Should be called in cases where there has been an input\n   * change that affects the evaluation of which rows should be rendered, e.g. toggling\n   * `multiTemplateDataRows` or adding/removing row definitions.\n   */\n  private _forceRenderDataRows() {\n    this._dataDiffer.diff([]);\n    this._rowOutlet.viewContainer.clear();\n    this.renderRows();\n  }\n\n  /**","sourceCodeStart":1401,"sourceCodeEnd":1437,"githubUrl":"https://github.com/angular/components/blob/0411926e7d8ae06b32236ec1048a888cfad5abf2/src/cdk/table/table.ts#L1401-L1437","documentation":"When extracting cell templates for a row definition, the table resolves each column id in rowDef.columns against registered column defs; an id with no registered CdkColumnDef throws this error. Same family as error 134 but raised while building the actual cell templates rather than sticky styles.","triggerScenarios":"_getCellTemplates / renderRow: Array.from(rowDef.columns, columnId => this._columnDefsByName.get(columnId)) returns undefined for some columnId — the row def's columns input names a column that doesn't exist in the table.","commonSituations":"matRowDef columns list containing ids not declared via matColumnDef (typo, removed column, wrong table); reusing a rowDef across two tables; dynamically computed column lists with stale entries.","solutions":["Ensure every id in the row def's columns is declared as <ng-container matColumnDef=\"id\"> within this table","Fix typos/case mismatches in the columns property of *matRowDef/*matHeaderRowDef","Remove or update stale column ids in the row def","Keep each row def's columns scoped to its own table's column defs"],"exampleFix":"// before\n<tr mat-row *matRowDef=\"let row; columns: ['name', 'qtyy']\"></tr> <!-- qtyy undeclared -->\n// after\n<tr mat-row *matRowDef=\"let row; columns: ['name', 'qty']\"></tr>","handlingStrategy":"validation","validationCode":"const declared = new Set(Array.from(el.querySelectorAll('[matColumnDef]')).map(c => c.getAttribute('matColumnDef')));\nrowDefColumns.forEach(id => { if (!declared.has(id)) throw new Error(`Row def references undeclared column: ${id}`); });","typeGuard":"function rowColumnsDeclared(cols: string[], declared: Set<string>): cols is string[] {\n  return cols.every(c => declared.has(c));\n}","tryCatchPattern":"try {\n  this.cdr.detectChanges();\n} catch (e) {\n  if (/Could not find column with id/.test(e.message)) {\n    console.error('Row def columns must all have matColumnDef declarations in this table.');\n  }\n}","preventionTips":["Derive row def columns from the same source as matColumnDef declarations","Avoid sharing row defs across tables","Grep templates for columns lists and cross-check ids"],"tags":["angular","cdk-table","unknown-column","template"],"backgroundTag":"unknown-column-id","analyzedSha":"0411926e7d8ae06b32236ec1048a888cfad5abf2","analyzedAt":"2026-08-31T11:58:23.400Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}