slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.49k stars 1.37k forks source link

Cannot export mermaid figures into pdf #1528

Closed apraga closed 7 months ago

apraga commented 7 months ago

Describe the bug Export to PDF fails for mermaid figures.

To Reproduce Steps to reproduce the behavior:

  1. Minimal working example from the documentation : test.md
    
    ---
    theme: default
    title: Title 
    ---

Test

```mermaid {theme: 'neutral', scale: 0.8} graph TD B[Text] --> C{Decision} C -->|One| D[Result 1] C -->|Two| E[Result 2] ```

2. Export to PDF 

 `npx slidev export  test.md`

Errors are 

●■▲ Slidev v0.48.9

theme @slidev/theme-default css engine unocss entry /home/alex/notes/slides/test.md ● rendering...locator.evaluate: Error: strict mode violation: locator('body').locator('#mermaid-rendering-container 1)

aka locator('#mermaid-rendering-container').first() 2)
aka locator('#mermaid-rendering-container').nth(1) 3)
aka locator('#mermaid-rendering-container').nth(2) 4)
aka locator('#mermaid-rendering-container').nth(3)

Call log:



**Desktop (please complete the following information):**
- OS: gentoo
- Browser: firefox
- Slidev version: 0.48.9

I've updated all dependencies. Any help appreciated, thanks !
apraga commented 7 months ago

The issue was actually a index.html laying around in the folder. Removing it solved it. Sorry for the noise...