knitr icon indicating copy to clipboard operation
knitr copied to clipboard

HTML screenshots on Ubuntu

Open markschl opened this issue 4 months ago • 0 comments

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 TMPDIR to some reachable location (e.g. under the current working directory)
  • using webshot instead of webshot2, although this gives me empty screenshots or an error with knitr; but calling webshot::webshot manually does work (at least after Sys.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).

markschl avatar Sep 01 '25 20:09 markschl