{"record":{"id":"b1e0891c85a2ba0f","repo":"mermaid-js/mermaid","slug":"no-such-shape-doc-shape-shape-names-should-be-b1e089","errorCode":null,"errorMessage":"No such shape: ${doc.shape}. Shape names should be lowercase.","messagePattern":"No such shape: (.+?)\\. Shape names should be lowercase\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mermaid/src/diagrams/kanban/kanbanDb.ts","lineNumber":132,"sourceCode":"    padding,\n    isGroup: false,\n  } satisfies KanbanNode;\n\n  if (shapeData !== undefined) {\n    let yamlData;\n    // detect if shapeData contains a newline character\n    // console.log('shapeData', shapeData);\n    if (!shapeData.includes('\\n')) {\n      // console.log('yamlData shapeData has no new lines', shapeData);\n      yamlData = '{\\n' + shapeData + '\\n}';\n    } else {\n      // console.log('yamlData shapeData has new lines', shapeData);\n      yamlData = shapeData + '\\n';\n    }\n    const doc = yaml.load(yamlData, { schema: yaml.JSON_SCHEMA }) as NodeMetaData;\n    // console.log('yamlData', doc);\n    if (doc.shape && (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes('_'))) {\n      throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);\n    }\n\n    // if shape is defined in the yaml data, use it if it is a valid shape kanbanItem\n    if (doc?.shape && doc.shape === 'kanbanItem') {\n      node.shape = doc?.shape;\n    }\n    if (doc?.label) {\n      node.label = doc?.label;\n    }\n    if (doc?.icon) {\n      node.icon = doc?.icon.toString();\n    }\n    if (doc?.assigned) {\n      node.assigned = doc?.assigned.toString();\n    }\n    if (doc?.ticket) {\n      node.ticket = doc?.ticket.toString();\n    }","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/mermaid-js/mermaid/blob/d93e9c88c01a599c062ee6a3f1462e3558ac6b90/packages/mermaid/src/diagrams/kanban/kanbanDb.ts#L114-L150","documentation":"Thrown by setMetadata when YAML metadata attached to a kanban item declares a shape field that is either not fully lowercase or contains an underscore. The guard rejects shapes that don't match the expected lowercase convention before they reach the shape-lookup logic, because kanban only supports a fixed set of shape names and a mismatched case or underscore would silently fail to match.","triggerScenarios":"Writing inline YAML metadata on a kanban item like {shape: KanbanItem} or {shape: kanban_item} — uppercase letters or underscores trip the check; also any custom shape value that doesn't follow lowercase-no-underscore naming.","commonSituations":"Copy-pasting shape names from docs that use TitleCase in prose; assuming underscore_separated names work because other diagrams use them; hand-writing JSON/YAML metadata blocks without normalizing case.","solutions":["Use the exact lowercase shape name with no underscores: the only currently accepted kanban shape is 'kanbanItem' — wait, note the check rejects underscores, so verify against the latest docs which shape tokens are valid.","Re-read the kanban metadata docs for the supported shape vocabulary and use the exact token.","Remove the shape field entirely to fall back to the default kanban item shape.","Validate your YAML with a linter before feeding it to mermaid."],"exampleFix":"// before\nitem @{{ shape: Kanban_Item }}\n\n// after — omit shape or use the documented lowercase token\nitem @{{ shape: kanbanItem }}","handlingStrategy":"validation","validationCode":"// Normalize/validate shape metadata before rendering.\nfunction normalizeShape(meta: { shape?: string }): string | null {\n  if (!meta.shape) return null;\n  if (meta.shape !== meta.shape.toLowerCase() || meta.shape.includes('_')) {\n    return `Shape '${meta.shape}' must be lowercase with no underscores`;\n  }\n  return null;\n}","typeGuard":"function isValidShapeName(shape: string): boolean {\n  return shape === shape.toLowerCase() && !shape.includes('_');\n}","tryCatchPattern":"try {\n  await mermaid.render('g', diagramText);\n} catch (e) {\n  if (e instanceof Error && /No such shape/.test(e.message)) {\n    showUserError('Shape names in kanban metadata must be lowercase with no underscores. Check the shape field in your item metadata.');\n  } else {\n    throw e;\n  }\n}","preventionTips":["Use lowercase-only shape names in kanban YAML metadata.","Avoid underscores in shape tokens.","Omit the shape field to use the default kanban item shape."],"tags":["mermaid","kanban","parsing","validation"],"backgroundTag":null,"analyzedSha":"d93e9c88c01a599c062ee6a3f1462e3558ac6b90","analyzedAt":"2026-08-12T06:23:11.304Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}