{"record":{"id":"34e9f664c5408aa1","repo":"remix-run/remix","slug":"invalid-column-columnname-for-table-tablenam","errorCode":null,"errorMessage":"Invalid column \"{columnName}\" for table \"{tableName}\". Expected a column(...) builder","messagePattern":"Invalid column \"(.+?)\" for table \"(.+?)\"\\. Expected a column\\(\\.\\.\\.\\) builder","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table/src/lib/table.ts","lineNumber":803,"sourceCode":"    }),\n  }) as ColumnReference<tableName, columnName>\n}\n\nfunction resolveTableColumns<columns extends TableColumnsDefinition>(\n  tableName: string,\n  columns: columns,\n): { [column in keyof columns & string]: ColumnDefinition } {\n  let columnDefinitions: Record<string, ColumnDefinition> = {}\n\n  for (let columnName in columns) {\n    if (!Object.prototype.hasOwnProperty.call(columns, columnName)) {\n      continue\n    }\n\n    let column = columns[columnName]\n\n    if (!(column instanceof ColumnBuilder)) {\n      throw new Error(\n        'Invalid column \"' +\n          columnName +\n          '\" for table \"' +\n          tableName +\n          '\". Expected a column(...) builder',\n      )\n    }\n\n    columnDefinitions[columnName] = column.build()\n  }\n\n  return Object.freeze(columnDefinitions) as {\n    [column in keyof columns & string]: ColumnDefinition\n  }\n}\n\n/**\n * Defines a one-to-many relation from `source` to `target`.","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table/src/lib/table.ts#L785-L821","documentation":"This error is thrown by resolveTableColumns when a table's column definition object contains a value that is not a ColumnBuilder instance. Every entry in the columns object passed to defineTable/createTable must be created with the column(...) builder so the library can read its type, options, and defaults.","triggerScenarios":"Passing a plain value, class instance, or imported non-builder (e.g. columns: { id: 1 } or { createdAt: SomeORM.column }) inside the table's columns definition; also wrapping columns in an extra layer or passing a serialized/parsed definition.","commonSituations":"Copy-pasting schema code from another ORM, forgetting to call column(), spreading plain objects into the columns definition, or a refactor that renamed the column import.","solutions":["Ensure every columns entry is created with the library's column(...) builder","Check for typos like passing column types (e.g. 'string') instead of column.string()","Remove any spread of non-builder objects from the columns definition"],"exampleFix":"// before\nconst posts = createTable('posts', {\n  title: 'string',\n})\n// after\nimport { column, createTable } from '...'\nconst posts = createTable('posts', {\n  title: column.string(),\n})","handlingStrategy":"validation","validationCode":"for (const [name, def] of Object.entries(columns)) {\n  if (!(def instanceof ColumnBuilder)) throw new TypeError(`column ${name} is not a builder`)\n}","typeGuard":"const isColumnBuilder = (v: unknown): v is ColumnBuilder => v instanceof ColumnBuilder","tryCatchPattern":null,"preventionTips":["Always construct columns with the library's column(...) builder","Type the columns argument as Record<string, ColumnBuilder> so TS rejects plain values"],"tags":["data-table","schema","columns","validation"],"backgroundTag":"invalid-schema-definition","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}