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

Mermaid rendering to PDF broken #10961

Open
sasja-san opened this issue Oct 3, 2024 · 2 comments
Open

Mermaid rendering to PDF broken #10961

sasja-san opened this issue Oct 3, 2024 · 2 comments
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction

Comments

@sasja-san
Copy link

sasja-san commented Oct 3, 2024

Bug description

I'm not able to render this code to a PDF. The Mermaid code was taken from here: https://quarto.org/docs/authoring/diagrams.html#mermaid

---
title: Mermaid Test
format: pdf
---


# Hello!


```{mermaid}
sequenceDiagram
  participant Alice
  participant Bob
  Alice->>John: Hello John, how are you?
  loop Healthcheck
    John->>John: Fight against hypochondria
  end
  Note right of John: Rational thoughts <br/>prevail!
  John-->>Alice: Great!
  John->>Bob: How about you?
  Bob-->>John: Jolly good!
```

Here's the error I get:

$ quarto render mermaid-test.qmd
ERROR: Internal Error: Couldn't find an svg element in svg string

This is a bug in quarto. We apologize for the inconvenience.
Please consider reporting it at https://github.com/quarto-dev/quarto-cli. Thank you!

Stack trace:
    at resolveSize (file:///home/sasja/.quarto/quarto-cli/src/core/svg.ts:24:11)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async makePng (file:///home/sasja/.quarto/quarto-cli/src/core/handlers/mermaid.ts:353:11)
    at async makeDefault (file:///home/sasja/.quarto/quarto-cli/src/core/handlers/mermaid.ts:435:16)
    at async Object.cell (file:///home/sasja/.quarto/quarto-cli/src/core/handlers/mermaid.ts:475:14)
    at async Promise.all (index 0)
    at async Object.document (file:///home/sasja/.quarto/quarto-cli/src/core/handlers/base.ts:577:20)
    at async handleLanguageCells (file:///home/sasja/.quarto/quarto-cli/src/core/handlers/base.ts:529:34)
    at async file:///home/sasja/.quarto/quarto-cli/src/command/render/render-files.ts:631:41
    at async withTimingAsync (file:///home/sasja/.quarto/quarto-cli/src/core/timing.ts:50:20)

Quarto check & version

I'm using the latest commit on main branch:

git show -s --format="%as %H"
2024-10-02 9d00acae2607c1d0fae479b0b8f830145454b207

From quarto check:

Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 9d00acae2607c1d0fae479b0b8f830145454b207
      Path: /home/sasja/.quarto/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2024.03.13
      Chromium: 869685

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/sasja/.TinyTeX/bin/x86_64-linux
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.5
      Path: /usr/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@sasja-san sasja-san added the bug Something isn't working label Oct 3, 2024
@cderv
Copy link
Collaborator

cderv commented Oct 3, 2024

Just to share on Windows this is rendering ok for me.

@cscheid cscheid added the needs-repro Issues that are blocked until reporter provides an adequate reproduction label Oct 3, 2024
@cscheid
Copy link
Collaborator

cscheid commented Oct 3, 2024

I also can't repro myself, either on 1.6.18 or main, on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-repro Issues that are blocked until reporter provides an adequate reproduction
Projects
None yet
Development

No branches or pull requests

3 participants