{"record":{"id":"6575a756104efc79","repo":"hcengineering/platform","slug":"kind-is-not-specified","errorCode":null,"errorMessage":"kind is not specified","messagePattern":"kind is not specified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/board-resources/src/components/CreateCard.svelte","lineNumber":58,"sourceCode":"  }\n\n  let kind: Ref<TaskType> | undefined = undefined\n\n  async function createCard () {\n    const sp = await client.findOne(board.class.Board, { _id: _space as Ref<Board> })\n    if (sp === undefined) {\n      throw new Error('Board not found')\n    }\n    const status = await client.findOne(\n      core.class.Status,\n      { space: sp.type },\n      { sort: { rank: SortingOrder.Ascending } }\n    )\n    if (status === undefined) {\n      throw new Error('Status not found')\n    }\n    if (kind === undefined) {\n      throw new Error('kind is not specified')\n    }\n    const sequence = await client.findOne(core.class.Sequence, { attachedTo: board.class.Card })\n    if (sequence === undefined) {\n      throw new Error('sequence object not found')\n    }\n\n    const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true)\n\n    const number = (incResult as any).object.sequence\n\n    const value: AttachedData<BoardCard> = {\n      status: status._id,\n      number,\n      title,\n      kind,\n      identifier: `CARD-${number}`,\n      rank: '',\n      assignee: null,","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/plugins/board-resources/src/components/CreateCard.svelte#L40-L76","documentation":"CreateCard.svelte throws this when the incoming `kind` parameter is undefined while creating a new card in a board. The card creation flow needs an explicit sequence kind to know which numbering sequence to apply; without it the operation is stopped before any object is written. It is a caller-contract error, not a system failure.","triggerScenarios":"Calling the card-creation handler (e.g. from the popup UI) without selecting/supplying a kind value, so `kind === undefined` when the function runs.","commonSituations":"Custom UI invoking the create handler directly, a form where the kind selector was skipped or not yet initialized, or a refactor that removed the kind argument/default.","solutions":["Ensure the caller selects a kind before invoking the create handler (disable the submit button until kind is set).","Supply a sensible default kind value in the caller or component props.","Add a type check/validation on the input so undefined kind never reaches the create path."],"exampleFix":"// before\nonCreate(title)\n// after\nif (kind === undefined) { showWarning('Select a kind'); return }\nonCreate(title, kind)","handlingStrategy":"validation","validationCode":"if (kind === undefined) { ui.notify('Select a kind first'); return }\n// safe to call create handler now","typeGuard":"function hasKind<T>(kind: T | undefined): kind is T { return kind !== undefined }","tryCatchPattern":"try {\n  await createCard(title, kind)\n} catch (e) {\n  if (e instanceof Error && e.message === 'kind is not specified') ui.notify('Please select a kind')\n  else throw e\n}","preventionTips":["Disable the create/submit button until all required fields (including kind) are selected.","Provide a default kind value in component props or config.","Validate inputs at the form layer before invoking data-layer handlers."],"tags":["validation","undefined","ui-state"],"backgroundTag":"missing-required-parameter","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}