quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.75k stars 306 forks source link

Error while rendering `mermaid` and `dot` in `format: pdf` #10626

Closed MarcellGranat closed 2 weeks ago

MarcellGranat commented 2 weeks ago

Bug description

I face a bug, when I want to render my document to pdf and it contains a mermaid fig.

Steps to reproduce

---
title: Nothing
format: pdf
---

```{mermaid}
flowchart TD

A --> B

Expected behavior

No response

Actual behavior

ERROR: TypeError: error sending request for url (http://localhost:9222/json/list): error trying to connect: tcp connect error: Connection refused (os error 61)

Stack trace:
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:391:7)
    at async externalRequest (file:///Applications/quarto/bin/quarto.js:38425:22)
    at async List (file:///Applications/quarto/bin/quarto.js:38452:21)
    at async Chrome._fetchDebuggerURL (file:///Applications/quarto/bin/quarto.js:38641:37)
    at async Chrome._start (file:///Applications/quarto/bin/quarto.js:38598:25)

Your environment

Quarto check output

Quarto 1.5.56 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.2.0: OK Dart Sass version 1.70.0: OK Deno version 1.41.0: OK Typst version 0.11.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.5.56 Path: /Applications/quarto/bin

[✓] Checking tools....................OK TinyTeX: v2023.04 Chromium: 869685

[✓] Checking LaTeX....................OK Using: TinyTex Path: /Users/marci/Library/TinyTeX/bin/universal-darwin Version: 2024

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

[✓] Checking Python 3 installation....OK Version: 3.12.0 Path: /usr/local/bin/python3 Jupyter: 5.7.2 Kernels: julia-1.9, python3

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

[✓] Checking R installation...........OK Version: 4.3.3 Path: /Library/Frameworks/R.framework/Resources LibPaths:

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

cscheid commented 2 weeks ago

Do you have corporate policies that don't restrict what you can do on your computer? Unfortunately, in order to get a screenshot in PDF, Quarto needs to use Chromium's remote interface, which involves starting a web server. I suspect that's what's happening here because of the error message.

ERROR: TypeError: error sending request for url (http://localhost:9222/json/list): error trying to connect: tcp connect error: Connection refused (os error 61)

We should improve this error message. But, if I'm correct, that's not a bug.

cscheid commented 2 weeks ago

Actually, I take it back. This is now failing for me as well on macOS, and wasn't as of a couple of months ago. Worrying, I do not think we changed any of the code anywhere - it must be something with Google Chrome's latest update.

aronatkins commented 2 weeks ago

The same error happens with documents using {dot} (graphviz) blocks.

cscheid commented 2 weeks ago

@aronatkins yes, and it'll happen in other formats besides pdf as well. We have a patch release ready to go and the latest 1.6 prerelease should have the fix already.

aronatkins commented 2 weeks ago

Understood. I added the comment mostly so other searchers would see that this was more than mermaid. Thanks for updating the title!