but the solution mentioned in that post does not work for me.
It is a markdown document that usually takes a minute or two to run on my PC.
It runs on Shinyapps and generates a html that fails to download.
The log says
Warning: Error in is_remote_protocol_ok: Cannot find headless Chrome after 20 attempts
This is my Server side code.
output$report <- downloadHandler(
# For PDF output, change this to "report.pdf"
filename = "report.pdf",
content = function(file) {
# Copy the report file to a temporary directory before processing it, in
# case we don't have write permissions to the current working dir (which
# can happen when deployed).
tempReport <- file.path(here("temp"), "report_2021.Rmd")
file.copy("report_2021.Rmd", tempReport, overwrite = TRUE)
# Set up parameters to pass to Rmd document
params <- list(Team = input$1, Level = input$Level, Year = input$Year,
Competition = input$4, Game = input$5)
# Knit the document, passing in the `params` list, and eval it in a
# child of the global environment (this isolates the code in the document
# from the code in this app).
library(rmarkdown)
out <- pagedown::chrome_print( render(tempReport, params = params,
envir = new.env(parent = globalenv())),
extra_args = c("--disable-gpu",
"--no-sandbox"),
wait = 15,
timeout = 300,
async = T,
verbose = TRUE
)
file.rename(out, file)
shiny::withProgress(
message = paste0("Downloading Report"),
value = 0,
{
shiny::incProgress(1/10)
Sys.sleep(1)
shiny::incProgress(5/10)
}
)
}
)
I did a dummy Shiny app on shinyapps.io that shows the result of lsb_release -c, see here: OS
shinyapps.io containers are now built on top of focal, so I can confirm you that this is the problem: chromium was installed with snap. I will open an issue.
Hi ! I added the extra_args and it worked. However, the next time I tried to upload an app that rendered Rmd I had the same problem. Thanks for opening the request @rlesur !
Hi, the new image is now deployed: pagedown::chrome_print() now works on shinyapps.io.
Please, do not hesitate to inspect my above mentioned project for further details on using pagedown::chrome_print() with this service.