question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using "style" in node name causes parse error

See original GitHub issue

Describe the bug Any usage of the word “style” in a node name causes a parsing error. This only happens when the word is lower case.

To Reproduce Steps to reproduce the behavior:

  • Create simple graph containing a node with style in it.
graph TD;
  a-style-project-name --> using-style-causes-parse-error
  style --> style2

See in Mermaid Live Editor

Expected behavior I expect to be able to use any word in the node name I want. If it is reserved there should be a way to escape it.

Additional context Tested with 8.3.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
heavysixercommented, Dec 4, 2019

I think this is a non issue. You can’t do something like let var = "foo" in JavaScript, and the same case is true here. The issue is that conceptually mermaid has a textual visual model of the graph, which tends to make the reserved words disappear. My suggestion is to use some sort of naming convention like Hungarian notation to bypass this problem.

0reactions
jgreywolfcommented, Aug 12, 2020

I am closing this item as “by design” with the idea of not being able to use “reserved” keywords as node names. However, we may still look at providing a way to escape strings per issue #1506

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-scripts build "Parse error on line 1"
Turns out there was a bug in postcss-calc module that comes with Create React app. I resolved the issue by ignoring that parser....
Read more >
Error.prototype.name - JavaScript - MDN Web Docs - Mozilla
The name data property of Error.prototype is shared by all Error instances. ... e.name is 'Error' e.name = "ParseError"; throw e; // e....
Read more >
13.2 Parsing HTML documents - HTML Standard - WhatWG
This error occurs if the parser encounters an attribute in a tag that already has an attribute with the same name. The parser...
Read more >
Errors | Node.js v19.3.0 Documentation
stackTraceLimit; error.cause; error.code; error.message; error.stack ... The first line of the trace will be prefixed with ${myObject.name}: ...
Read more >
Lezer Reference Manual - CodeMirror
Each node in a syntax tree has a node type associated with it. name: string. The name of the node type. Not necessarily...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found