Why this happens
Bare node IDs (the identifier before a shape like [Label]) can't contain spaces -- Mermaid treats whitespace as a statement separator. a b[Label] parses as node a followed by an unrelated node b[Label], which isn't valid on its own line.
This is easy to trigger by accident: typing a descriptive ID like user profile instead of userProfile or user_profile.
How to fix it
Use a single unbroken token for the node ID -- camelCase, snake_case, or hyphens all work: userProfile[Label], user_profile[Label]. Put the human-readable text inside the shape's brackets, not in the ID.