{"record":{"id":"9662e81b9059114a","repo":"TanStack/table","slug":"aggregationfn-string-ref-for-column-colum","errorCode":null,"errorMessage":"aggregationFn '${String(ref)}' for column '${column.id}' is not registered","messagePattern":"aggregationFn '(.+?)' for column '(.+?)' is not registered","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/table-core/src/features/row-aggregation/rowAggregationFeature.utils.ts","lineNumber":223,"sourceCode":"  }\n\n  return aggregationFn\n}\n\nfunction resolveAggregationFn<\n  TFeatures extends TableFeatures,\n  TData extends RowData,\n>(\n  column: Column_Internal<TFeatures, TData, any>,\n  ref: AggregationFnRef<TFeatures, TData, any, any>,\n): AggregationFnDef<TFeatures, TData, any, any> | undefined {\n  if (isAggregationFnDef(ref)) return ref as any\n  if (ref === 'auto') return column_getAutoAggregationFn(column)\n\n  const aggregationFn =\n    column.table._rowModelFns.aggregationFns?.[ref as string]\n  if (!aggregationFn) {\n    warn(\n      `aggregationFn '${String(ref)}' for column '${column.id}' is not registered`,\n    )\n  }\n  return aggregationFn\n}\n\n/** Resolves and validates a column's scalar or multiple aggregation option. */\nexport function column_getAggregationFns<\n  TFeatures extends TableFeatures,\n  TData extends RowData,\n  TValue extends CellData = CellData,\n>(\n  column: Column_Internal<TFeatures, TData, TValue>,\n): ReadonlyArray<ResolvedAggregationFn<TFeatures, TData>> {\n  const option = column.columnDef.aggregationFn\n  const registry = column.table._rowModelFns.aggregationFns\n  const coreRowModel = column.table.getCoreRowModel()\n  const previous = (column as any)._resolvedAggregationFnsCache as","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/TanStack/table/blob/d01c01bedbab0ff6c2641f18b2fc9a11545d9bf6/packages/table-core/src/features/row-aggregation/rowAggregationFeature.utils.ts#L205-L241","documentation":"`resolveAggregationFn` maps a column's `aggregationFn` ref: function/definition objects pass through, `'auto'` delegates to auto-detection, and string refs are looked up in `table._rowModelFns.aggregationFns`. This warning fires when a string ref has no registry entry, so `column_getAggregationFns` resolves it to `undefined` and the aggregated cell renders empty. It is a dev-only signal that the referenced aggregation function name was never registered for this table instance.","triggerScenarios":"Setting `aggregationFn: 'sum'` / `'mean'` / any custom string on a columnDef while the table's `aggregationFns` registry omits that exact key; typo or case mismatch in the ref; registry object replaced after table creation while the option string stayed; array-valued options where one element is an unregistered string.","commonSituations":"Renaming custom aggregation fns during refactors; copy-pasting columnDefs between projects with different registries; forgetting to register a new custom aggregation before using it in a column.","solutions":["Compare the string in the warning with `Object.keys(table._rowModelFns.aggregationFns ?? {})` and fix the key/ref mismatch.","Register the missing function under that exact name in the aggregationFns registry.","Pass the aggregation definition object directly (`{ aggregate(...) {...} }`) instead of a string name.","If the intent was auto-detection, use the literal `'auto'` rather than an unregistered name.","Ensure registry identity is stable: create the aggregationFns record once (module scope or useMemo) so lookups keep resolving."],"exampleFix":"// before\n{ header: 'Total', accessorKey: 'amount', aggregationFn: 'sumAll' } // not registered\n\n// after\n{ header: 'Total', accessorKey: 'amount', aggregationFn: 'sum' } // key exists in aggregationFns","handlingStrategy":"type-guard","validationCode":"function assertAggregationRefRegistered(ref: unknown, fns: Record<string, unknown> | undefined) {\n  if (typeof ref === 'string' && ref !== 'auto' && (!fns || !(ref in fns))) {\n    throw new Error(`aggregationFn '${ref}' not registered. Available: ${Object.keys(fns ?? {}).join(', ')}`)\n  }\n}","typeGuard":"function isRegisteredAggregationRef(\n  ref: unknown,\n  fns: Record<string, unknown> | undefined,\n): ref is string {\n  return (\n    typeof ref === 'string' &&\n    (ref === 'auto' || (!!fns && ref in fns))\n  )\n}","tryCatchPattern":"try {\n  const entries = column.getAggregationFns()\n  for (const entry of entries) {\n    if (entry.aggregationFn === undefined) {\n      console.warn(`column aggregation '${entry.id}' unresolved — check registry`)\n    }\n  }\n} catch (e) {\n  console.error('aggregation fn resolution failed', e)\n}","preventionTips":["Define aggregation fn names as a const object and derive both registry keys and columnDef refs from it (single source of truth).","Write a test that resolves every aggregationFn ref used in your column defs.","Pass definition objects instead of strings when the fn is local to the component."],"tags":["aggregation","unregistered-function","configuration","dev-warning"],"backgroundTag":"unregistered-function-name","analyzedSha":"d01c01bedbab0ff6c2641f18b2fc9a11545d9bf6","analyzedAt":"2026-08-28T21:52:44.679Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}