-
Notifications
You must be signed in to change notification settings - Fork 331
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
Quarto presentation render fails on second try after deleting cache when using cache
with leaflet::addProviderTiles
#4149
Comments
@cderv Maybe you have expertise here? I'm not familiar with how the knitr cache works. |
I should note that I converted this presentation from Rpres format to qmd and that is when I noted the problem. As an Rpres presentation, it worked fine. |
It is happening with R Markdown too. So definitely something going on leaflet, knitr and/or rmarkdown. I don't think it is directly Quarto related. I'll look closer to debug. thanks for the report ! |
I only tried Rpres (where it worked, or at least it didn't create an error) and Quarto (where it did not), so can't say for Rmarkdown... |
@dmkaplan2000 this is an issue with how leaflet HTML dependency for using tile providers works (loaded by It using a temp file in a R temporary directory which does not exists anymore in a following render. So cache won't find the HTML dependency. I don't exactly know why you don't get error with Rpres though. Maybe because caching works a bit specifically between rendering that in Rmd or Qmd with knitr Anyway, you can follow there - I'll close this on Quarto side. Thanks for the report! |
For anyone looking for a workaround in quarto before gets rstudio/leaflet#843 resolved , try adding knitr:
opts_knit:
always_allow_html: yes
opts_chunk:
screenshot.force: true |
I'm still getting this issue and Leaflet for R hasn't provided a solution. How can you stop leaflet providers from trying to use a temp file? |
This bug persists. |
@michelk could you open an issue mentioning this one and provide sufficient information as requested in the bug report template? Thank you. |
@michelk please to update all of your R packages related to this issue. it has been fixed upstream in leaflet version 2.2.1 and leaflet.providers version 2.0.0 Be sure to have those versions installed. You can follow all the related links from the leaflet issue report linked above to see how this has been fixed. Hope this helps |
@cderv Thanks for coming back to me. I still have the problem. Here is an example: ---
title: Test Document
date: today
lang: de
execute:
echo: false
warning: false
cache: true
---
# un
```{r}
library(mapview)
mapview(breweries, layer.name = "T1")
```
# dos
```{r}
library(mapview)
mapview(breweries, layer.name = "T2")
```
# tres
```{r}
library(plainview)
mapview(poppendorf[[5]], legend = TRUE, layer.name = "T3")
```
I get the follwing error message from
R session info
|
I can't reproduce using your file. It works for me ok. Please try in a fresh new session, and if it happens again, open a new issue by sharing your reproducible example. You can share using special syntax - no need to upload file always |
Not sure what you mean with "fresh new session". I still get the error after deleting the cache files.
|
You place your project elsewhere on your machine as if you were starting it from scratch. |
@michelk as asked, please do open new issue. This time I have done it for you in #9058 so that we can continue discuss in its own thread. General advice: It is usually recommended (at least within this repo) to start a new issue with reproducible examples, and updated versions of tools, instead of adding more in a thread that is closed. This one is already 1 year old! Let's keep discussing in #9058 now - thanks |
Bug description
Note: I reported this over at community.rstudio.com, but I suppose that this is a better place for it.
I am using RStudio 2022.12.0 Build 353 with R version 4.2.2 Patched (2022-11-10 r83330) and knitr-1.41 on a Ubuntu 20.04.5 LTS installation.
I have identified a problem using
cache: true
in a quarto document that uses theleaflet
package, specifically when usingaddProviderTiles
. An example document that demonstrates the problem is below:The document renders without problem the first time before the
cache
exists, but the second time it fails with the following error about missing dependencies:Deleting the cache allows it to render again, but one looses the
cache
functionality.Checklist
The text was updated successfully, but these errors were encountered: