0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

MermaidのエラーExpecting 'ACTOR', got '___'の解決法

Last updated at Posted at 2025-11-22

解決策

予約語を利用してしまっているので名前を変えればいい
この記事で特別読む価値がある部分は以上

今回の事案

仕様整理のためにAIに以下のMermaidのシーケンス図を書かせた

sequenceDiagram
    participant Client
    participant Create
    participant Header
    participant DB

    Client->>Create: json
    Create->>Create: createTask()
    Create->>Header: json with Name Date Content
    Create->>Create: generateUuid()
    Create->>Header: Add Uuid
    Header->>DB: json with Uuid Name Date Content

しかし、これをNotionのコードブロックに貼り付けると以下のエラーが出た

Parse error on line 6:
...ant DB    Client->>Create: json    Cre
----------------------^
Expecting '+', '-', 'ACTOR', got 'create'  

再度AIに修正を求めたがちゃんと表示されるものが出てこない
依然として同じエラーが出続ける
ネットを検索したが解説している記事が少なくて解決策がわからないまま1時間くらい費やしてしまった
結論を言うとCreateという名称が予約語に指定されていて利用できないとのことだった
CreatTaskみたいな別の名称にすればちゃんと表示されるようになった

最後に

冷静に解決策が分かってから考えると、エラー読めば分かったやんって感じで大変馬鹿馬鹿しくなった
今後同様の人のエラーに遭遇した人が時間を無駄にすることがないように記事に残しておく

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?