{"record":{"id":"575cb15c7b4ad850","repo":"mermaid-js/mermaid","slug":"target-box-not-found-for-frame-command-frame-nam","errorCode":null,"errorMessage":"Target box not found for frame ${command.frame.name}","messagePattern":"Target box not found for frame (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mermaid/src/diagrams/eventmodeling/db.ts","lineNumber":580,"sourceCode":"    const box = boxes[i];\n    if (box.swimlane.index !== targetSwimlane) {\n      return box;\n    }\n  }\n  return undefined;\n}\n\nfunction decidePositionRelation(state: Context, _command: Command): Event[] {\n  const command = _command as PositionRelation;\n\n  if (isEmResetFrame(command.frame) || isFirstFrame(command.index, command.frame)) {\n    return [];\n  }\n\n  const targetBox = findBoxByFrame(state.boxes, command.frame);\n\n  if (targetBox === undefined) {\n    throw new Error(`Target box not found for frame ${command.frame.name}`);\n  }\n\n  let sourceBox;\n  if (command.sourceFrame) {\n    sourceBox = findBoxByFrame(state.boxes, command.sourceFrame);\n  } else {\n    sourceBox = findBoxByLineIndex(state.boxes, targetBox.swimlane.index, command.index - 1);\n  }\n\n  if (sourceBox === undefined) {\n    // Source box not found for frame ${command.frame.name}\n    return [];\n  }\n  const event: RelationPositioned = {\n    $kind: RelationPositionedKind,\n    frame: command.frame,\n    index: command.index,\n    sourceBox,","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/mermaid-js/mermaid/blob/d93e9c88c01a599c062ee6a3f1462e3558ac6b90/packages/mermaid/src/diagrams/eventmodeling/db.ts#L562-L598","documentation":"Error \"Target box not found for frame ${command.frame.name}\" thrown in mermaid-js/mermaid.","triggerScenarios":"Thrown at packages/mermaid/src/diagrams/eventmodeling/db.ts:580 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-12T18:17:37.767Z"}