Leaflet map not displaying in RStudio viewer

Good morning - just upgraded R and RStudio this morning and leaflet appears to no longer display in the viewer. It seems similar to this previous issue - basic leaflet map not showing in the viewer - #2 by woodward

library(leaflet)

leaflet() |>
addTiles()

sessionInfo -

sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 22631)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8

time zone: America/Los_Angeles
tzcode source: internal

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

other attached packages:
[1] rlang_1.1.3 leaflet_2.2.2

loaded via a namespace (and not attached):
[1] digest_0.6.35 R6_2.5.1 lubridate_1.9.3 fastmap_1.1.1 tidyselect_1.2.1
[6] magrittr_2.0.3 glue_1.7.0 stringr_1.5.1 htmltools_0.5.8.1 timechange_0.3.0
[11] generics_0.1.3 lifecycle_1.0.4 DT_0.33 cli_3.6.2 jquerylib_0.1.4
[16] snakecase_0.11.1 compiler_4.4.0 rstudioapi_0.16.0 tools_4.4.0 janitor_2.2.0
[21] jsonlite_1.8.8 htmlwidgets_1.6.4 stringi_1.8.3 crosstalk_1.2.1

1 Like

I'm experiencing this same issue after updating R and RStudio today when trying to display a map in the viewer pane using either leaflet or tmap packages. Both were working prior to the upgrade. Tried on two PCs, both running Windows 10.

Same here, following upgrade to 4.4.0 and 2024.4.
MapView displays same issue.
Maps are rendered OK (saved widgets will display correctly in browser)

Probably related to this open issue:

3 Likes

Thanks for finding that ongoing issue. Leaflet maps still display in shiny apps, just not in the viewer pane within the 'Files, Plots, Packages, Help, Viewer, Presentation' panel.

Within Windows 10, I have the same issue where Rstudio 2024.04.0 Build 735 combined with R-4.4.0 will not display leaflet 2.2.2 generated maps in the viewer. Looking at the temporary files (type "tempdir()" in the console) directory, the HTML file has been created and is useable outside of Rstudio. Reverting to R-4.3.3 restores the expected viewer functionality within Rstudio. Updating all packages to current releases such as "leaflet 2.2.2" did not help.
Temporary solution: within Rstudio options, change the R version to a choice not "R-4.4.0"

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.