Skip to content
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

HTML document does not compile with mapview v2.9.0 #312

Closed
fawda123 opened this issue Aug 12, 2020 · 30 comments
Closed

HTML document does not compile with mapview v2.9.0 #312

fawda123 opened this issue Aug 12, 2020 · 30 comments

Comments

@fawda123
Copy link

Using the latest mapview release (as of Aug. 11, v2.9.0) produces this error when rendering the .Rmd file to HTML with knitr.

---
output: html_document
---

```{r}
library(mapview)
mapview(breweries)
```
List of 10
 $ name      : chr "PopupTable"
 $ version   : chr "0.0.1"
 $ src       :List of 1
  ..$ file: chr ""
 $ meta      : NULL
 $ script    : NULL
 $ stylesheet: chr "popup.css"
 $ head      : NULL
 $ attachment: NULL
 $ package   : NULL
 $ all_files : logi TRUE
 - attr(*, "class")= chr "html_dependency"
Error: path for html_dependency not found: 
Execution halted

It works fine with the previous release (v 2.7.8).

- Session info ------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 4.0.2 (2020-06-22)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/New_York            
 date     2020-08-12                  

- Packages ----------------------------------------------------------------------------------------------------------------------------------------
 package     * version date       lib source        
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)
 backports     1.1.8   2020-06-17 [1] CRAN (R 4.0.1)
 base64enc     0.1-3   2015-07-28 [1] CRAN (R 4.0.0)
 callr         3.4.3   2020-03-28 [1] CRAN (R 4.0.0)
 class         7.3-17  2020-04-26 [2] CRAN (R 4.0.2)
 classInt      0.4-3   2020-04-07 [1] CRAN (R 4.0.0)
 cli           2.0.2   2020-02-28 [1] CRAN (R 4.0.0)
 codetools     0.2-16  2018-12-24 [2] CRAN (R 4.0.2)
 colorspace    1.4-1   2019-03-18 [1] CRAN (R 4.0.0)
 crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)
 crosstalk     1.1.0.1 2020-03-13 [1] CRAN (R 4.0.0)
 DBI           1.1.0   2019-12-15 [1] CRAN (R 4.0.0)
 desc          1.2.0   2018-05-01 [1] CRAN (R 4.0.0)
 devtools      2.3.1   2020-07-21 [1] CRAN (R 4.0.2)
 digest        0.6.25  2020-02-23 [1] CRAN (R 4.0.0)
 dplyr         1.0.1   2020-07-31 [1] CRAN (R 4.0.1)
 e1071         1.7-3   2019-11-26 [1] CRAN (R 4.0.0)
 ellipsis      0.3.1   2020-05-15 [1] CRAN (R 4.0.0)
 evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)
 fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)
 fs            1.5.0   2020-07-31 [1] CRAN (R 4.0.2)
 generics      0.0.2   2018-11-29 [1] CRAN (R 4.0.0)
 glue          1.4.1   2020-05-13 [1] CRAN (R 4.0.0)
 htmltools     0.5.0   2020-06-16 [1] CRAN (R 4.0.0)
 htmlwidgets   1.5.1   2019-10-08 [1] CRAN (R 4.0.0)
 KernSmooth    2.23-17 2020-04-26 [2] CRAN (R 4.0.2)
 knitr       * 1.29    2020-06-23 [1] CRAN (R 4.0.2)
 lattice       0.20-41 2020-04-02 [2] CRAN (R 4.0.2)
 leafem        0.1.3   2020-07-26 [1] CRAN (R 4.0.2)
 leaflet       2.0.3   2019-11-16 [1] CRAN (R 4.0.2)
 lifecycle     0.2.0   2020-03-06 [1] CRAN (R 4.0.0)
 magrittr      1.5     2014-11-22 [1] CRAN (R 4.0.0)
 mapview     * 2.9.0   2020-08-11 [1] CRAN (R 4.0.2)
 memoise       1.1.0   2017-04-21 [1] CRAN (R 4.0.0)
 munsell       0.5.0   2018-06-12 [1] CRAN (R 4.0.0)
 pillar        1.4.6   2020-07-10 [1] CRAN (R 4.0.1)
 pkgbuild      1.1.0   2020-07-13 [1] CRAN (R 4.0.1)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.0.0)
 pkgload       1.1.0   2020-05-29 [1] CRAN (R 4.0.0)
 png           0.1-7   2013-12-03 [1] CRAN (R 4.0.0)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)
 processx      3.4.3   2020-07-05 [1] CRAN (R 4.0.2)
 ps            1.3.4   2020-08-11 [1] CRAN (R 4.0.1)
 purrr         0.3.4   2020-04-17 [1] CRAN (R 4.0.0)
 R6            2.4.1   2019-11-12 [1] CRAN (R 4.0.0)
 raster        3.3-13  2020-07-17 [1] CRAN (R 4.0.1)
 Rcpp          1.0.5   2020-07-06 [1] CRAN (R 4.0.1)
 remotes       2.2.0   2020-07-21 [1] CRAN (R 4.0.2)
 rlang         0.4.7   2020-07-09 [1] CRAN (R 4.0.1)
 rmarkdown   * 2.3     2020-06-18 [1] CRAN (R 4.0.2)
 rprojroot     1.3-2   2018-01-03 [1] CRAN (R 4.0.0)
 rstudioapi    0.11    2020-02-07 [1] CRAN (R 4.0.0)
 satellite     1.0.2   2019-12-09 [1] CRAN (R 4.0.0)
 scales        1.1.1   2020-05-11 [1] CRAN (R 4.0.0)
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)
 sf            0.9-5   2020-07-14 [1] CRAN (R 4.0.1)
 sp            1.4-2   2020-05-20 [1] CRAN (R 4.0.0)
 testthat      2.3.2   2020-03-02 [1] CRAN (R 4.0.0)
 tibble        3.0.3   2020-07-10 [1] CRAN (R 4.0.1)
 tidyselect    1.1.0   2020-05-11 [1] CRAN (R 4.0.0)
 units         0.6-7   2020-06-13 [1] CRAN (R 4.0.0)
 usethis       1.6.1   2020-04-29 [1] CRAN (R 4.0.0)
 vctrs         0.3.2   2020-07-15 [1] CRAN (R 4.0.1)
 webshot       0.5.2   2019-11-22 [1] CRAN (R 4.0.0)
 withr         2.2.0   2020-04-20 [1] CRAN (R 4.0.0)
 xfun          0.16    2020-07-24 [1] CRAN (R 4.0.1)

[1] C:/Users/mbeck/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.2/library
@tim-salabim
Copy link
Member

Does it work if you install.packages("leafpop")? And maybe call library(leafpop) in the rmd?

@fawda123
Copy link
Author

No, that doesn't help. I'm still getting the same error.

@BennyWag
Copy link

BennyWag commented Aug 15, 2020

I encountered the same issue today with version 2.9.0. Only possible fix was to downgrade manually to 2.7.8. Code I ran (to test things out:

---
title: "testing mapview"
date: "15/08/2020"
output: html_document
---
{r setup, include=FALSE}
library(sf)
library(leaflet)
library(mapview)
library(tidyverse)
{r}
address<-data.frame(x = 145.050361, y = -37.829332)

address_sf<-address%>%st_as_sf(coords = 1:2, crs = 4326)
{r, eval = T}
mapview::mapview(address_sf)

Returns the same error as @fawda123 :

List of 10
 $ name      : chr "PopupTable"
 $ version   : chr "0.0.1"
 $ src       :List of 1
  ..$ file: chr ""
 $ meta      : NULL
 $ script    : NULL
 $ stylesheet: chr "popup.css"
 $ head      : NULL
 $ attachment: NULL
 $ package   : NULL
 $ all_files : logi TRUE
 - attr(*, "class")= chr "html_dependency"
Error: path for html_dependency not found: 
Execution halted

tim-salabim added a commit that referenced this issue Aug 15, 2020
@tim-salabim
Copy link
Member

tim-salabim commented Aug 15, 2020

Thanks everyone, and sorry for the mess. I've been meaning to address this in the release, but it seems I deleted some necessary css items too early. This should work again now, though the popups look rather plain now (no colored rows). Please retry with

remotes::install_github("r-spatial/mapview")

and let me know if the error still persists.

@BennyWag
Copy link

Hi @tim-salabim.
this worked for me now, when knitting in rmarkdown, thanks. Nevertheless I ran into another issue with both versions (2.7.8 and 2.9), when compiling a bookdown html file:

List of 10
 $ name      : chr "leaflet-providers"
 $ version   : chr "1.9.0"
 $ src       :List of 1
  ..$ file: chr "C:/Users/xxx/AppData/Local/Temp/RtmpYZDNdv"
 $ meta      : NULL
 $ script    : chr "leaflet-providers_1.9.0.js"
 $ stylesheet: NULL
 $ head      : NULL
 $ attachment: NULL
 $ package   : NULL
 $ all_files : logi FALSE
 - attr(*, "class")= chr "html_dependency"
Error: path for html_dependency not found: C:/Users/bwagner/AppData/Local/Temp/RtmpYZDNdv
Execution halted

Exited with status 1.

A shown in the list, my version of leaflet providers is 1.9. Any idea why this could happen?

@tim-salabim
Copy link
Member

This has nothing to do with mapview per se. See rstudio/bookdown#15 for potential solutions.

@BennyWag
Copy link

Thanks

@tim-salabim
Copy link
Member

@fawda123 does this work for you now?

@fawda123
Copy link
Author

@tim-salabim yep, the dev version worked for me. Thanks for the fix!

@victoriadancoMNRF
Copy link

yes, this fixed the error for me too! thank you!

@nuest
Copy link

nuest commented Aug 29, 2020

Just to add one more error message for other users potentially having this problem: installing version 2.9.2 from master branch just now solved this one for me:

> mapshot(webmap1, file="webmap1.png")
File filea487e3be533f7_files/PopupTable-0.0.1/popup.css not found in resource path
Error: pandoc document conversion failed with error 99

@Dulani
Copy link

Dulani commented Aug 31, 2020

Thanks everyone, and sorry for the mess. I've been meaning to address this in the release, but it seems I deleted some necessary css items too early. This should work again now, though the popups look rather plain now (no colored rows). Please retry with

remotes::install_github("r-spatial/mapview@develop")

and let me know if the error still persists.

On Tuesday (6 days ago), I upgraded GDAL to solve a particular problem and then upgraded many of my dependent packages as I hit errors. When I hit this one (html_dependency error for popup.css), I just couldn't get past it until I ran across this page (and Tim's update). So, thanks! (Everything is working for me now!)

@mhweber
Copy link

mhweber commented Aug 31, 2020

Was having this exact same issue this afternoon and retried after running the mapview@develop install as you suggested @Dulani and worked perfectly - thanks!

@tim-salabim
Copy link
Member

Thanks! I've updated the comment with installation instruction above to not use @develop anymore (that branch is being deprecated).

So for future updates from github, please simply install as follows:

remotes::install_github("r-spatial/mapview")

@alexyshr
Copy link

My solution was knitting using Rgui.exe not RStudio: rmarkdown::render("name.Rmd", "html_document")

@clarahlaurent
Copy link

clarahlaurent commented Oct 29, 2020

Using R version 4.0.2 (2020-06-22), Platform: x86_64-apple-darwin17.0 (64-bit)

Hi, I am having a similar issue when trying to run a shiny app on R Studio cloud. (and exactly the same as issue #324) I have installed the mapview github update as recommended by Tim, but I am still getting the same error message. Here is what is printed in my console:

Warning: Error in value[[3L]]: Couldn't normalize path in `addResourcePath`, with arguments: `prefix` = 'PopupTable-0.0.1'; `directoryPath` = ''
  106: stop
  105: value[[3L]]
  104: tryCatchOne
  103: tryCatchList
  102: tryCatch
  101: addResourcePath
  100: FUN
   99: lapply
   98: renderWidget
   97: transform
   96: func
   94: f
   93: Reduce
   84: do
   83: hybrid_chain
   82: origRenderFunc
   81: output$leeds_bins
    1: runApp

And a simplified version of my code:

ui <- fluidPage(
  mapviewOutput("map")
)

server <- function(input, output) {
  output$map <- renderLeaflet({
    mapview(data)
  })
}

shinyApp(ui = ui, server = server)

The app runs fine on R Studio. Do you know what I could be doing wrong in R Studio Cloud? Thanks!

@tim-salabim
Copy link
Member

Are you sure that on RStudio Cloud the mapview version is > 2.9.0?

@clarahlaurent
Copy link

Hi Tim, thanks for your reply!
It is working now - I added "@Map" after my call to mapview and it worked!
Yes, I was using the 2.9.4 version of mapview.

@tim-salabim
Copy link
Member

Oh yeah, I should've spotted that. Glad you found out yourself

@barbara-hutniczak
Copy link

Hi @tim-salabim,

I used the 'remotes::install_github("r-spatial/mapview")' fix and the app runs fine, but it gives me difficult to read pop-up windows because you cannot scroll through them.

Any solution to that?

@tim-salabim
Copy link
Member

@barbara-hutniczak Can you provide a reproducible example?

@barbara-hutniczak
Copy link

Hi Tim,

Same code, deployed to shinyapps.io gives me the nicer scrollable windows:
shinyapps

But deployed to azure VM running on centos 8, working only after using the fix above 'remotes::install_github("r-spatial/mapview")', gives me full pop-up window:
azure

@cf416
Copy link

cf416 commented Nov 7, 2020

Hi, I also had the pandoc error 99 with version 2.9.0 when trying to save with mapshot. Now I updated to version 2.9.4 and I got a slightly different error:
> mapshot(mymap, file="mymap.png") Could not determine mime type for file77e2e593224_files/study_region-0.0.1/study_region_layer.fgb'
Error: pandoc document conversion failed with error 63`

Is there anything I could try to fix this? Many thanks for any suggestion.

This is my session info:
`> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] leafem_0.1.3 leaflet_2.0.3 mapview_2.9.4 sf_0.9-6
`

@tim-salabim
Copy link
Member

In rmarkdown you need to set mapviewOptions(fgb = FALSE). Then things should work

@cf416
Copy link

cf416 commented Nov 7, 2020

I'm not using rmarkdown, anyway I tried to set that option and I got the previous error again:
> mapshot(mymap, file="mymap.png")
File file77e3c9a345c_files/PopupTable-0.0.1/popup.css not found in resource path
Error: pandoc document conversion failed with error 99

@tim-salabim
Copy link
Member

Are you sure this is mapview 2.9.4?

@cf416
Copy link

cf416 commented Nov 8, 2020

Just an update for anyone facing the same issue, I solved the mapshot pandoc error in Mapview version 2.9.4 installing PhantomJS through webshot::install_phantomjs() as suggested in a warning message.

@pateljay7018
Copy link

Thanks everyone, and sorry for the mess. I've been meaning to address this in the release, but it seems I deleted some necessary css items too early. This should work again now, though the popups look rather plain now (no colored rows). Please retry with

remotes::install_github("r-spatial/mapview@develop")

this is a work wall and solve my error

jeroen added a commit to ropensci/ruODK that referenced this issue Mar 11, 2021
Remove when new mapview is on CRAN
@jeroen
Copy link

jeroen commented Mar 11, 2021

Also ran into this, for an rOpenSci package (after some debugging). Maybe time for a CRAN release 🚀 😄

@tim-salabim
Copy link
Member

I hear you :-) . Let me fix a couple of bugs and release the deps first though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests