computorg / computo-quarto-extension

Quarto extension for Computo template
https://computorg.github.io/computo-quarto-extension/
MIT License
16 stars 4 forks source link

Compilation fails on local machine due to webshot #7

Closed jchiquet closed 11 months ago

jchiquet commented 1 year ago

The rendering of the PDF fails on my machine with the following error

`geom_smooth()` using method = 'loess' and formula 'y ~ x'
Quitting from lines 189-195 (template.qmd) 
Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744,  : 
  webshot.js returned failure value: 1
Calls: .main ... html_screenshot -> in_dir -> do.call -> <Anonymous>
In addition: Warning message:
In is.null(x) || is.na(x) : 'length(x) = 4 > 1' in coercion to 'logical(1)'

It may be due to the fact that reticulate uses Python version 3.8 : @fradav , do you have any clue on this problem ?

thanks.

fradav commented 1 year ago

You have to install the phantomjs endpoint for webshot as done in the .Renviron file:

setHook(packageEvent("plotly","onLoad"), function (...) webshot::install_phantomjs())

Just do webshot::install_phantomjs() otherwise.

It’s needed only to render static “screenshots” of web only plots rendered by plotly or htmlwidgets for pdf/latex outputs.

jchiquet commented 1 year ago

Thanks, for the records, I had to set the following environment variable for this to work export OPENSSL_CONF=/etc/ssl (in term) and force the install of phantom.js with webshot::install_phantomjs(force = TRUE) (in R)

fradav commented 1 year ago

Already reported there: https://github.com/wch/webshot/issues/90