{"record":{"id":"eaa8261e444cd09a","repo":"mermaid-js/mermaid","slug":"position-were-undefined-for-commit-commit-id","errorCode":null,"errorMessage":"Position were undefined for commit ${commit.id}","messagePattern":"Position were undefined for commit (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mermaid/src/diagrams/git/gitGraphRenderer.ts","lineNumber":555,"sourceCode":"      const currentPosition = commitPos.get(commit.id) ?? defaultCommitPosition;\n      return currentPosition.y - COMMIT_STEP;\n    } else {\n      return 0;\n    }\n  }\n  return 0;\n};\n\nconst getCommitPosition = (\n  commit: Commit,\n  pos: number,\n  isParallelCommits: boolean\n): CommitPositionOffset => {\n  const posWithOffset = dir === 'BT' && isParallelCommits ? pos : pos + LAYOUT_OFFSET;\n  const branchY = branchPos.get(commit.branch)?.pos;\n  const x = dir === 'TB' || dir === 'BT' ? branchPos.get(commit.branch)?.pos : posWithOffset;\n  if (x === undefined || branchY === undefined) {\n    throw new Error(`Position were undefined for commit ${commit.id}`);\n  }\n  const useReduxGeometry = REDUX_GEOMETRY_THEMES.has(getConfig().theme ?? '');\n  const y =\n    dir === 'TB' || dir === 'BT'\n      ? posWithOffset\n      : branchY + (useReduxGeometry ? REDUX_BRANCH_LABEL_PADDING_Y / 2 + 1 : -2);\n  return { x, y, posWithOffset };\n};\n\nconst drawCommits = (\n  svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>,\n  commits: Map<string, Commit>,\n  modifyGraph: boolean,\n  gitGraphConfig: GitGraphDiagramConfig\n) => {\n  const gBullets = svg.append('g').attr('class', 'commit-bullets');\n  const gLabels = svg.append('g').attr('class', 'commit-labels');\n  let pos = dir === 'TB' || dir === 'BT' ? defaultPos : 0;","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/mermaid-js/mermaid/blob/d93e9c88c01a599c062ee6a3f1462e3558ac6b90/packages/mermaid/src/diagrams/git/gitGraphRenderer.ts#L537-L573","documentation":"Error \"Position were undefined for commit ${commit.id}\" thrown in mermaid-js/mermaid.","triggerScenarios":"Thrown at packages/mermaid/src/diagrams/git/gitGraphRenderer.ts:555 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d93e9c88c01a599c062ee6a3f1462e3558ac6b90","analyzedAt":"2026-08-12T06:23:11.304Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}