mermaid-js/mermaid · error · Error

Tag bbox not found

Error message

Tag bbox not found

What it means

Error "Tag bbox not found" thrown in mermaid-js/mermaid.

Source

Thrown at packages/mermaid/src/diagrams/git/gitGraphRenderer.ts:426

  pos: number
) => {
  if (commit.tags.length > 0) {
    let yOffset = 0;
    let maxTagBboxWidth = 0;
    let maxTagBboxHeight = 0;
    const tagElements = [];

    for (const tagValue of commit.tags.reverse()) {
      const rect = gLabels.insert('polygon');
      const hole = gLabels.append('circle');
      const tag = gLabels
        .append('text')
        .attr('y', commitPosition.y - 16 - yOffset)
        .attr('class', 'tag-label')
        .text(tagValue);
      const tagBbox = tag.node()?.getBBox();
      if (!tagBbox) {
        throw new Error('Tag bbox not found');
      }

      maxTagBboxWidth = Math.max(maxTagBboxWidth, tagBbox.width);
      maxTagBboxHeight = Math.max(maxTagBboxHeight, tagBbox.height);

      tag.attr('x', commitPosition.posWithOffset - tagBbox.width / 2);

      tagElements.push({
        tag,
        hole,
        rect,
        yOffset,
      });

      yOffset += 20;
    }

    for (const { tag, hole, rect, yOffset } of tagElements) {

View on GitHub (pinned to d93e9c88c0)

When it happens

Trigger: Thrown at packages/mermaid/src/diagrams/git/gitGraphRenderer.ts:426 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mermaid-js/mermaid@d93e9c88c0 (2026-08-12). Data as JSON: /api/errors/6ef1fc2568f11f63. Report an issue: GitHub.