-
Notifications
You must be signed in to change notification settings - Fork 320
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
puppeteer with chromium on Linux fails and causes "Internal Error: need an svg element" #6821
Comments
The same source works fine on Windows, quarto version 1.3.450 Output: processing file: essential.qmd output file: essential.knit.md pandoc metadata running xelatex - 1 running xelatex - 2 Output created: essential.pdf |
Upgrading to 1.3.450 on Ubuntu did not help. (base) ondrej@smicro:/tmp$ sudo dpkg -i quarto-1.3.450-linux-amd64.deb Error: Internal Error: need an svg element |
Are you able to try rendering this again after installing google chrome? We've had a recurring source of issues where quarto can't locate a web browser in order to be able to extract the dynamically-generated figure from the webpage. You also have a minor issue in your syntax:
The |
Note that Quarto can help you install a headless version of Chrome, see https://quarto.org/docs/authoring/diagrams.html#chrome-install. quarto tools install chromium |
Reinstalling chromium did not help. (base) ondrej@smicro:~$ quarto tools uninstall chromium Uninstalling chromium Error: Internal Error: need an svg element |
Thanks for following up. Do you have access to Google Chrome itself (instead of chromium through our tools)? |
Installing google-chrome indeed prevents the internal bug. I used wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb After installing it via dpkg -i , the error does not reproduce. (base) ondrej@smicro:~$ quarto render essential.qmd --to pdf metadata running xelatex - 1 running xelatex - 2 Output created: essential.pdf (base) ondrej@smicro:~$ |
Thanks for confirming! We've never been able to track down precisely why some installs of chromium on Linux cause puppeteer to fail. I'm going to keep this open, but unfortunately I don't have any better workaround to offer right now. |
It seems similar to issue with WSL where chromium can't be installed, and full chrome is needed
We now ask WSL user to install manually like this Lines 89 to 95 in f9bb1eb
Maybe it is something related to a component missing... Anyhow, just mentionning for referencing and cross linking |
@cderv : I did all of the suggested steps manually on WSL2, yet the error still persists ➜ google-chrome --version
Google Chrome 120.0.6099.129
(base)
|
@younes-io first screenshot you posted was related, and the messages told you what to do. If you don't have the message anymore it means it worked. Now you get this :
this errors seems to have no relation to chromium, and Hint: I would check you theme file for
If you still have problem, feel free to reach out in a new thread. Thank you |
Bug description
Rendering any quarto file with mermaid diagram to pdf results in internal error.
ERROR: Internal Error: need an svg element
Error: Internal Error: need an svg element
Steps to reproduce
Run quarto render essential.qmd --to pdf
A minimal file is the following
Expected behavior
No error should happen.
Actual behavior
(base) ondrej@smicro:~$ quarto render essential.qmd --to pdf
ERROR: Internal Error: need an svg element
Error: Internal Error: need an svg element
at resolveSize (file:///opt/quarto/bin/quarto.js:83711:15)
at async makePng (file:///opt/quarto/bin/quarto.js:84047:57)
at async makeDefault (file:///opt/quarto/bin/quarto.js:84097:24)
at async Object.cell (file:///opt/quarto/bin/quarto.js:84120:20)
at async Promise.all (index 0)
at async Object.document (file:///opt/quarto/bin/quarto.js:57716:25)
at async handleLanguageCells (file:///opt/quarto/bin/quarto.js:57687:42)
at async file:///opt/quarto/bin/quarto.js:86617:61
at async withTimingAsync (file:///opt/quarto/bin/quarto.js:19633:25)
at async renderFiles (file:///opt/quarto/bin/quarto.js:86616:25)
Your environment
Quarto check output
(base) ondrej@smicro:~$ quarto check
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.433
Path: /opt/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.8.5 (Conda)
Path: /home/ondrej/miniconda3/bin/python
Jupyter: (None)
[✓] Checking R installation...........OK
Version: 4.3.1
Path: /usr/lib/R
LibPaths:
- /home/ondrej/R/x86_64-pc-linux-gnu-library/4.3
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.43
rmarkdown: 2.6
[✓] Checking Knitr engine render......OK
The text was updated successfully, but these errors were encountered: