{"record":{"id":"81b6f3fda52bdd85","repo":"mermaid-js/mermaid","slug":"edge-limit-exceeded-this-edges-length-edges-fo","errorCode":null,"errorMessage":"Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.","messagePattern":"Edge limit exceeded\\. (.+?) edges found, but the limit is (.+?)\\.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges\\.\nYou cannot set this config via configuration inside the diagram as it is a secure config\\.\nYou have to call mermaid\\.initialize\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mermaid/src/diagrams/flowchart/flowDb.ts","lineNumber":334,"sourceCode":"      edge.id = id;\n      edge.isUserDefinedId = true;\n    } else {\n      const existingLinks = this.edges.filter((e) => e.start === edge.start && e.end === edge.end);\n      if (existingLinks.length === 0) {\n        edge.id = getEdgeId(edge.start, edge.end, { counter: 0, prefix: 'L' });\n      } else {\n        edge.id = getEdgeId(edge.start, edge.end, {\n          counter: existingLinks.length + 1,\n          prefix: 'L',\n        });\n      }\n    }\n\n    if (this.edges.length < (this.config.maxEdges ?? 500)) {\n      log.info('Pushing edge...');\n      this.edges.push(edge);\n    } else {\n      throw new Error(\n        `Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`\n      );\n    }\n  }\n\n  private isLinkData(value: unknown): value is LinkData {\n    return (\n      value !== null &&\n      typeof value === 'object' &&\n      'id' in value &&\n      typeof (value as LinkData).id === 'string'\n    );\n  }\n","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/mermaid-js/mermaid/blob/d93e9c88c01a599c062ee6a3f1462e3558ac6b90/packages/mermaid/src/diagrams/flowchart/flowDb.ts#L316-L352","documentation":"Error \"Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.\" thrown in mermaid-js/mermaid.","triggerScenarios":"Thrown at packages/mermaid/src/diagrams/flowchart/flowDb.ts:334 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-13T04:17:16.726Z"}