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

Syntax error in text mermaid version 10.9.0 #5454

Closed
dariuszwojtowicz opened this issue Apr 11, 2024 · 1 comment
Closed

Syntax error in text mermaid version 10.9.0 #5454

dariuszwojtowicz opened this issue Apr 11, 2024 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@dariuszwojtowicz
Copy link

Description

When I try to render diagrams with Mermaid version 10 or above I always get this error instead of diagram
"Syntax error in text
mermaid version 10.9.0"

I tried many different diagrams and all of them work with version 9.0.0, but none works with 10 or higher.

This is my React Component with hardcoded Mermaid code.

import * as React from 'react';
import mermaid from 'mermaid';


mermaid.initialize({
  startOnLoad: true,
  securityLevel: 'loose',
  fontFamily: 'monospace',
  fontSize: 14,
});

export const MermaidDiagram: React.FC = ({children}) => {
  React.useEffect(() => {
    mermaid.contentLoaded();
  }, []);

  const diagram = `pie title NETFLIX
  "Time spent looking for movie" : 90
  "Time spent watching it" : 10
`;

  return <code className="mermaid">{diagram}</code>;
};

Steps to reproduce

  1. With Mermaid 10 or above, render any diagram code which works well with v9.0.0
  2. No diagram is rendered, instead I see this error "Syntax error in text mermaid version 10.9.0" rendered.

Screenshots

Screenshot by Dropbox Capture

Code Sample

No response

Setup

  • Mermaid version: 10.9.0
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

No response

Additional Context

No response

@dariuszwojtowicz dariuszwojtowicz added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Apr 11, 2024
@niclinn
Copy link

niclinn commented Jun 2, 2024

What was the fix?

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

2 participants