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

【bug回报】插入mermaid图报错 #187

Closed
ArcticLampyrid opened this issue Jun 22, 2023 · 0 comments
Closed

【bug回报】插入mermaid图报错 #187

ArcticLampyrid opened this issue Jun 22, 2023 · 0 comments
Labels
🐛bug Something isn't working

Comments

@ArcticLampyrid
Copy link
Collaborator

ArcticLampyrid commented Jun 22, 2023

插入mermaid图报错:

ERROR Render HTML failed: index.html
TypeError: /home/xxx/work/repos/blog/node_modules/hexo-theme-kratos-rebirth/layout/layout.ejs:22
    20| 
    21|         <%- partial('_partial/footer') %>
 >> 22|         <%- partial('_partial/after-footer') %>
    23|     </body>
    24| </html>

/home/xxx/work/repos/blog/node_modules/hexo-theme-kratos-rebirth/layout/_partial/after-footer.ejs:36
    34| <!-- Extra support for third-party plguins  -->
    35| <% if (config.mermaid && config.mermaid.enable || theme.mermaid && theme.mermaid.enable) { %>
 >> 36|     <%- partial('../_plugins/mermaid', { mermaidConfig: config.mermaid || theme.mermaid }) %>
    37| <% } %>
    38| 

/home/xxx/work/repos/blog/node_modules/hexo-theme-kratos-rebirth/layout/_plugins/mermaid.ejs:10
    8|     };
    9|     if (typeof mermaid == 'undefined') {
 >> 10|         const src = '<%- url_npm_cdn(`mermaid", "dist/mermaid.min.js`) %>';
    11|         $.getScript(src, init);
    12|     }
    13|     // Set PJAX callback function

Cannot read properties of undefined (reading 'includes')

已经安装

npm install hexo-filter-mermaid-diagrams

主题目录下已经设置

# Mermaid tag
mermaid:
  enable: true
  # Available themes: default | dark | forest | neutral
  theme: forest

插入的代码

sequenceDiagram
    Client->>Server: SYN=1, ack=0, seq=x
    Server->>Client: SYN=1, ack=1, seq=y, ack=x + 1
    Client->>Server: ACK=1, seq=x + 1, ack=y + 1
sequenceDiagram
    Client->>Server: SYN=1, ack=0, seq=x
    Server->>Client: SYN=1, ack=1, seq=y, ack=x + 1
    Client->>Server: ACK=1, seq=x + 1, ack=y + 1
Loading

同样的配置 next 主题没有报错,mermaid 图正常显示,请问我的配置出现了问题吗?

Originally posted by @tyokyo320 in #47 (comment)

@ArcticLampyrid ArcticLampyrid added the 🐛bug Something isn't working label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant