Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flowchart] Error with self-reference #5282

Closed
Spixmaster opened this issue Feb 13, 2024 · 2 comments
Closed

[Flowchart] Error with self-reference #5282

Spixmaster opened this issue Feb 13, 2024 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@Spixmaster
Copy link

Spixmaster commented Feb 13, 2024

Description

Generating a flowchart element which depends on itself causes an error. This was not the case in prior versions like the recent one from August 2023.

Steps to reproduce

Used command: mmdc -c "${XDG_CONFIG_HOME}"/mermaid/mermaid.json -f -i input.mmd -o output.pdf

Config file:

{
    "maxEdges": 999999,
    "maxTextSize": 999999,
    "theme": "dark"
}

Output:

Generating single mermaid chart

Error: Evaluation failed: DOMException: Failed to execute 'structuredClone' on 'Window': function jW(t){return new sBA(t)} could not be cloned.
    at file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html:118:5524
    at Array.forEach (<anonymous>)
    at $Pt (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html:118:4924)
    at QGA (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html:118:13704)
    at Object.BOt [as draw] (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html:119:1284)
    at Object.m8t [as render] (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/dist/index.html:87:1415)
    at ExecutionContext._ExecutionContext_evaluate (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:254:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ExecutionContext.js:143:16)
    at async CDPJSHandle.evaluate (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/JSHandle.js:56:16)
    at async CDPElementHandle.$eval (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/common/ElementHandle.js:86:24)
    at async renderMermaid (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:246:22)
    at async parseMMD (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:218:20)
    at async run (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:479:20)
    at async cli (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:184:3)

Screenshots

No response

Code Sample

flowchart LR
    %% Materialtyp
    materialtyp --> materialtyp %% This line causes the issue.

    subgraph materialtyp["Materialtyp"]
        direction LR
        style materialtyp fill:#2FEFCC
        materialtyp-start(("Materialtyp"))
        materialtyp-operation["# Materialtyp erstellen
- *Verwaltung > Struktur > Taxonomie > Materialtyp*
- Kategorisierung von Materialien"]
        materialtyp-dokument[/"Materialtyp"/]
        materialtyp-ende([" "])
        materialtyp-start --> materialtyp-operation --> materialtyp-dokument --> materialtyp-ende
    end

Setup

  • version mermaid-cli: 10.8.0
  • Browser and Version: mhromium 121.0.6167.160

Suggested Solutions

No response

Additional Context

No response

@Spixmaster Spixmaster added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Feb 13, 2024
@Spixmaster
Copy link
Author

Spixmaster commented Feb 13, 2024

I just tested some versions of mermaid-cli.

v10.3.1: works
v10.4.0: works
v10.5.0: does not work
v10.7.0: does not work
v10.8.0: does not work

@Spixmaster
Copy link
Author

Spixmaster commented Sep 10, 2024

I just tested version 11.1.1 and it does not have the bug anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant