Error reference / flowchart, graph

Parse error: got 'PS'

A square-bracket label contains a raw ( or ), which Mermaid reads as the start of a different node shape rather than as label text.

Parse error on line 2:
...hart TD    a[Login (OAuth)] --> b[Done]
----------------------^
Expecting 'SQE', 'DOUBLECIRCLEEND', 'PE', ... got 'PS'

Why this happens

Mermaid uses ( and ) to open round-edged and stadium-shaped nodes. Inside a [ ] label, an unescaped parenthesis is ambiguous: the parser can't tell whether you meant literal text or the start of a nested shape, and it fails.

This shows up constantly in real diagrams -- API names, function signatures, and parenthetical asides ("Login (OAuth)", "process(data)") are exactly the text that trips it.

How to fix it

Wrap the whole label in double quotes: a["Login (OAuth)"]. Quoted text is treated as a literal string, so parentheses, colons, and most other punctuation are safe inside it.

For heavy punctuation, quoting the label is more reliable than trying to escape individual characters.

Broken

Fails to parse

Rendering preview...
flowchart TD
    a[Login (OAuth)] --> b[Done]

Fixed

Renders correctly

Rendering preview...
flowchart TD
    a["Login (OAuth)"] --> b[Done]
Open fixed version in studio

More errors