{"record":{"id":"a4b9f4af18dbd474","repo":"vuetifyjs/vuetify","slug":"missing-selection","errorCode":null,"errorMessage":"Missing selection!","messagePattern":"Missing selection!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/vuetify/src/components/VDataTable/composables/select.ts","lineNumber":211,"sourceCode":"    selectAll,\n    isSelected,\n    isSomeSelected,\n    someSelected,\n    allSelected,\n    showSelectAll,\n    lastSelectedIndex,\n    selectStrategy,\n  }\n\n  provide(VDataTableSelectionSymbol, data)\n\n  return data\n}\n\nexport function useSelection () {\n  const data = inject(VDataTableSelectionSymbol)\n\n  if (!data) throw new Error('Missing selection!')\n\n  return data\n}\n","sourceCodeStart":193,"sourceCodeEnd":215,"githubUrl":"https://github.com/vuetifyjs/vuetify/blob/8d153908dffb7592eb389ddbfbab955a0ccc977f/packages/vuetify/src/components/VDataTable/composables/select.ts#L193-L215","documentation":"Thrown by useSelection() when inject(VDataTableSelectionSymbol) is undefined. Selection state is created by createSelection() and provided by the data-table root; row/cell components consume it.","triggerScenarios":"Calling useSelection() in a component that is not a descendant of a VDataTable-family component that ran createSelection.","commonSituations":"Building a custom selectable row renderer outside the table, using the selection composable standalone, or duplicate Vuetify installs breaking symbol identity.","solutions":["Call useSelection() only inside descendants of a VDataTable-family component.","For a custom table, run createSelection(...) and provide(VDataTableSelectionSymbol, data).","Confirm a single Vuetify install (Symbol.for keys must resolve identically)."],"exampleFix":"// before\nconst { toggleSelect } = useSelection()\n\n// after\nimport { createSelection, VDataTableSelectionSymbol } from 'vuetify/components/VDataTable/composables/select'\nconst data = createSelection(/* props */, /* emit */)\nprovide(VDataTableSelectionSymbol, data)","handlingStrategy":"type-guard","validationCode":"import { inject } from 'vue'\nimport { VDataTableSelectionSymbol } from 'vuetify/components/VDataTable/composables/select'\nfunction hasSelectionProvider(): boolean {\n  return inject(VDataTableSelectionSymbol, null) != null\n}","typeGuard":"import { inject } from 'vue'\nimport { VDataTableSelectionSymbol } from 'vuetify/components/VDataTable/composables/select'\nfunction insideSelectableTable(): boolean {\n  return inject(VDataTableSelectionSymbol, null) != null\n}","tryCatchPattern":"try {\n  useSelection()\n} catch (e) {\n  if (e instanceof Error && /Missing selection/.test(e.message)) {\n    // local selection fallback\n  } else throw e\n}","preventionTips":["Use selection composables only inside VDataTable descendants.","Re-provide the symbol when forking the table.","Maintain a single Vuetify install."],"tags":["vdatatable","injection","composable-misuse","vue"],"backgroundTag":null,"analyzedSha":"8d153908dffb7592eb389ddbfbab955a0ccc977f","analyzedAt":"2026-08-12T21:54:20.596Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}