knitr
knitr copied to clipboard
HTML screenshots on Ubuntu
When testing screenshots of htmlwidgets in non-HTML documents (e.g. PDF) on Ubuntu 24.04, I was faced with ERR_FILE_NOT_FOUND. After some research I finally realized that this is due to the Snap-based Chromium browser not being able to access /tmp (see here and here). Currently, I see only two not very nice solutions:
- setting
TMPDIRto some reachable location (e.g. under the current working directory) - using
webshotinstead ofwebshot2, although this gives me empty screenshots or an error with knitr; but callingwebshot::webshotmanually does work (at least afterSys.setenv(OPENSSL_CONF="/dev/null"); see here)
Is there any recommendation how to best deal with this problem? Would it be possible to configure Knitr to use a local temporary directory? Right now, this is not possible (see here).