Repository navigation
Closed
Description
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/
Reacted by Michael Thomas, alecloudenback, eitsupi, Kendon Bell and Patricio Del Boca
Activity
cderv commentedon Oct 3, 2024
Just to share on Windows this is rendering ok for me.
cscheid commentedon Oct 3, 2024
I also can't repro myself, either on 1.6.18 or
main, on macOS.sasja-san commentedon Oct 8, 2024
I'm using Manjaro Linux. Is there something I could do to test what might be going on? Maybe there are clues in the call stack?
mcanouil commentedon Oct 8, 2024
@sasja-san See https://quarto.org/docs/troubleshooting/index.html
sasja-san commentedon Oct 8, 2024
The only thing that I did there (which was applicable to me, the env variable settings gave me nothing) was update my install of TinyTex from v2024.03.13 to v2024.10 - but the error remains.
I dug around a bit in the code trying to figure out what's wrong. I don't know any typescript so I don't really know what I'm doing. Anyway, in
src/core/svg.tsi added some code at around line 23:which gave me this output:
I would try to make a long string with all the things in this
domobject as well, but I don't really know how that's done. Basically what I want to do is something likeIf anyone could help me with this, then I can dig a little deeper.
github-actions commentedon Oct 23, 2024
Thank you for using Quarto and reporting an issue!
Unfortunately, this issue is now considered stale because it has been opened since 14 days without providing a "working" reproducible example to help us investigate.
If you are still facing the issue, please review the "Bug Reports" guide on how to provide a fully reproducible example as a self-contained Quarto document or a link to a Git repository.
Without a reproducible example, it is unlikely that the issue will be addressed.
You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four
````).cderv commentedon Oct 23, 2024
@sasja-san can you try with Quarto v1.5 and latest Quarto v1.6 ? Though we are facing #11135 if you have recent build of chrome :(
cscheid commentedon Oct 23, 2024
Yeah, I think this is "just" a duplicate of #11135
sasja-san commentedon Oct 28, 2024
Sorry I missed this. The tab was active on a virtual desktop I didn't look at for a while, so I cleared the notification without noticing.
I installed and tested with both 1.5.57 and 1.6.31.
Verson 1.6 gave me the same error but version 1.5 gave me a pdf.
As I said previously, I don't know any typescript. But if any of you have suggestions for some code I could use to proceed with poking around I'd gladly try it out.
cderv commentedon Oct 29, 2024
Is this still with the same example shared above in #10961 (comment) ?
I still can't reproduce. What is your chrome version on your system ?
To debug further, you can activate Debug logging (https://quarto.org/docs/troubleshooting/#verbose-mode) and see if anything else is helping.
The thing I would if I was able to reproduce would be to try interactively debug dev version inside VSCODE. We don't have a step by step guide for that yet, so one would need to be confortable with VSCODE debugging and quarto dev.
Hopefully, we'll manage to find a reproducible environment for that. Which OS are you on ?
sasja-san commentedon Oct 29, 2024
Yes.
From
quarto check.To the best of my knowledge I have no other instances of chromium installed. Except maybe bundled ones, if that's what Electron is doing.
Do you have some command for me which I could run to check that I don't have some fishy stuff on my system?
I'm cool with this. I even wrote a tutorial (rendered using Quarto) about debugging in VS Code:
https://github.com/sasja-san/vscode-remote-debug-example
I have pretty much zero experience of TypeScript, though. But that's subject to change ;)
(though the image there lies, as I have now installed a 65W CPU in my nine years old powerhouse of a computer XD)
41 remaining items
mcanouil commentedon Oct 15, 2025
FYI for the latest Brave 1.83.112, the chromium version used is 141.0.7390.70 (https://brave.com/latest/)
So the version of chromium/brave reported is very odd.
frucht-salat commentedon Oct 17, 2025
Hi, sorry to be late. I tried with chromium and brave, that might have been confusing.
I got this running btw on my Linux with docker:
Not sure if the chromium flags are needed, but this renders a PDF. Only problem is, that the mermaid diagrams are cut if too big.
cderv commentedon Oct 17, 2025
This is a different issue, and possibly related to setting fig size for diagram.
Otherwise, glad it works with you docker setup
Xenon-Chameleon commentedon Oct 23, 2025
On MacOS ARM via Positron and Quarto 1.8.25 I'm having the same issues with the same error rendering PDF files that @sasja-san originally posted with the same stack trace. I tried tinytex and lualatex engines.
The live preview and html render works but I couldn't render my Mermaid chart with the chromium installed via
quarto install chromium.The only workaround I could find was installing the Google Chrome application. Quarto was able to recognize and use that to render the pdf. The Brave browser I had installed was not recognized the same way.
Is this still a problem with headless chromium or is there a different method I should use to install Chromium? I would prefer headless Chromium or a different method of rendering Mermaid than keeping the Chrome browser on my computer.
cderv commentedon Oct 23, 2025
It is a problem with the version installed by
quarto install chromium. You need another chrome or chromium installed without quarto. I'll fix that for 1.9.As you'll find on some thread, using chrome-headless-shell binary will work, but you need to set the env var
QUARTO_CHROMIUMfor Quarto to use this chrome version.You should also be able to use a recent chromium binary.
sakthivelvelumani commentedon Oct 24, 2025
I have the same problem but thanks to @Zujiry I was able to render my document with mermaid on docker.
davidnortes commentedon Jan 22, 2026
I encountered the same problem today. Just in case it provides new information or new hints for a solution: the only way I have found to solve it is to stop using the Snap version of Chromium altogether. As soon as I switched to the .deb version of Chrome, document rendering worked fine.
operating system: ubuntu 24.04
quarto version: 1.8.27
chromium: 143.0.7499.192 Snap
chrome: 144.0.7559.96 (deb)
cderv commentedon Feb 13, 2026
Next pre-release 1.9.21 will have a quarto install chrome-headless-shell that will install a lighter-weight binary that chromium and will solve the mermaid issue.
benz0li commentedon Mar 23, 2026
I tested with Quarto 1.9.36 + Pandoc 3.8.3 + Chrome Headless Shell again.
The following hangs:
On a Linux machine with Docker installed:
The following works:
On a Linux machine with Docker installed:
ℹ️ The only difference:
cd $HOMEmcanouil commentedon Mar 23, 2026
@benz0li Could you open a new issue referencing this one? This is a closed issue.
Install chrome directly, not via quarto