{"record":{"id":"f8d6a39c28fa4283","repo":"remix-run/remix","slug":"option-optionname-for-table-gettablename-tab","errorCode":null,"errorMessage":"Option \"{optionName}\" for table \"{getTableName(table)}\" must not be empty","messagePattern":"Option \"(.+?)\" for table \"(.+?)\" must not be empty","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/data-table/src/lib/table.ts","lineNumber":1138,"sourceCode":"  defaultValue: readonly string[],\n): string[] {\n  return normalizeKeysForTable(table, selector, optionName, defaultValue)\n}\n\nfunction normalizeKeysForTable(\n  table: AnyTable,\n  selector: string | readonly string[] | undefined,\n  optionName: string,\n  defaultValue: readonly string[],\n): string[] {\n  if (selector === undefined) {\n    return [...defaultValue]\n  }\n\n  let keys = Array.isArray(selector) ? [...selector] : [selector]\n\n  if (keys.length === 0) {\n    throw new Error(\n      'Option \"' + optionName + '\" for table \"' + getTableName(table) + '\" must not be empty',\n    )\n  }\n\n  let columns = getTableColumns(table)\n\n  for (let key of keys) {\n    if (!Object.prototype.hasOwnProperty.call(columns, key)) {\n      throw new Error(\n        'Unknown column \"' +\n          key +\n          '\" in option \"' +\n          optionName +\n          '\" for table \"' +\n          getTableName(table) +\n          '\"',\n      )\n    }","sourceCodeStart":1120,"sourceCodeEnd":1156,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/data-table/src/lib/table.ts#L1120-L1156","documentation":"Table options like unique constraints or indexes that accept a column selector reject empty arrays: at least one column must be selected. This error names the option that received an empty selector.","triggerScenarios":"Passing unique: [] or index: [] (or a selector that spreads an empty array) in a table's options.","commonSituations":"Options built dynamically from config or metadata lists that are empty in some cases; defaults that unintentionally override a populated selector.","solutions":["Ensure the option's column list has at least one entry","Skip the option entirely when the dynamic list is empty","Check spreads/defaults are not replacing the list with an empty array"],"exampleFix":"// before\ncreateTable('t', cols, { unique: maybeKeys })\n// after\ncreateTable('t', cols, maybeKeys.length ? { unique: maybeKeys } : {})","handlingStrategy":"validation","validationCode":"if (selector.length === 0) throw new Error('selector must not be empty')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Skip empty selector options instead of passing []","Validate computed column lists before passing to table options"],"tags":["data-table","schema","options"],"backgroundTag":"schema-validation-failed","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}