{"record":{"id":"ee5fee0dd62b83ed","repo":"mermaid-js/mermaid","slug":"c4-shape-fromnode-alias-has-no-intersect-func","errorCode":null,"errorMessage":"C4 shape \"${fromNode.alias}\" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues","messagePattern":"C4 shape \"(.+?)\" has no intersect function\\. Please report this to https://github\\.com/mermaid-js/mermaid/issues","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mermaid/src/diagrams/c4/c4Renderer.ts","lineNumber":345,"sourceCode":"  currentBounds.bumpLastMargin(conf.c4ShapeMargin);\n};\n\nclass Point {\n  x: number;\n  y: number;\n\n  constructor(x: number, y: number) {\n    this.x = x;\n    this.y = y;\n  }\n}\n\n/*\n * Get the intersection of the line between the center point of a rectangle and a point outside the rectangle.\n */\nconst getIntersectPoint = function (fromNode: C4Shape, endPoint: Point): Point | null {\n  if (!fromNode.intersect) {\n    throw new Error(\n      `C4 shape \"${fromNode.alias}\" has no intersect function. Please report this to https://github.com/mermaid-js/mermaid/issues`\n    );\n  }\n  const { x, y } = fromNode.intersect(endPoint);\n  return new Point(x, y);\n};\n\nconst getIntersectPoints = function (fromNode: C4Shape, endNode: C4Shape) {\n  const endIntersectPoint = { x: 0, y: 0 };\n  endIntersectPoint.x = endNode.x + endNode.width / 2;\n  endIntersectPoint.y = endNode.y + endNode.height / 2;\n  const startPoint = getIntersectPoint(fromNode, endIntersectPoint);\n\n  endIntersectPoint.x = fromNode.x + fromNode.width / 2;\n  endIntersectPoint.y = fromNode.y + fromNode.height / 2;\n  const endPoint = getIntersectPoint(endNode, endIntersectPoint);\n  return { startPoint: startPoint, endPoint: endPoint };\n};","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/mermaid-js/mermaid/blob/d93e9c88c01a599c062ee6a3f1462e3558ac6b90/packages/mermaid/src/diagrams/c4/c4Renderer.ts#L327-L363","documentation":"Thrown by getIntersectPoint when a C4Shape has no `intersect` function. The intersect function is normally assigned to each c4Shape during drawC4ShapeArray pass 2 (c4Shape.intersect = node.intersect). If it is missing when drawRels later tries to compute edge endpoints, this error fires. The message itself directs users to file a bug, signalling this is considered an internal invariant violation rather than a user-input error.","triggerScenarios":"Calling drawRels on a C4Shape whose intersect was never set — e.g. because drawC4ShapeArray was skipped, errored mid-pass for that shape, or the underlying unified shape did not provide an intersect function.","commonSituations":"Internal bug where a shape handler in the registry does not attach an intersect function; partial render after an earlier shape threw; shape handler mismatch across versions.","solutions":["Report the issue to https://github.com/mermaid-js/mermaid/issues as the message instructs, including the diagram that triggers it.","Simplify the C4 diagram (fewer/custom shape variants) to isolate which shape lacks the intersect function.","Upgrade mermaid — the missing intersect assignment may be fixed in a newer release."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await mermaid.render(id, c4DiagramText);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('has no intersect function')) {\n    // Internal invariant violation — report upstream and simplify the diagram.\n  }\n  throw err;\n}","preventionTips":["Avoid exotic or custom C4 shapes that may not attach an intersect function.","Keep mermaid current; this path is treated as a bug."],"tags":["c4","shape","internal","bug","relationship"],"backgroundTag":null,"analyzedSha":"d93e9c88c01a599c062ee6a3f1462e3558ac6b90","analyzedAt":"2026-08-12T06:23:11.304Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}