Maps do not render in current macOS Safari
dwachsmuth opened this issue · comments
Describe the bug
I am completely unable to get any mapdeck maps to display in the current version of Safari (15.1, running on macOS Monterey 12.0.1).
To Reproduce
library(sf)
library(mapdeck)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
mapdeck() |>
add_polygon(nc)
Expected behaviour
In the RStudio viewer, this launches a map of NC, as expected. Opening the localhost session in Chrome produces the same result. But opening the session in Safari produces a blank window.
Screenshots
Output in RStudio:
Versions
I'm on mapdeck 0.3.4, on R 4.1.1, on macOS 12.0.1. I have verified that this bug exists on two separate Macs running the same stack.
Other notes
I encountered this bug in the context of a very complex Shiny app I develop that uses mapdeck extensively; in the course of trying to find a minimal reprex, I realized that every single map failed to render. I don't have access to older versions of macOS/Safari, but a colleague was able to use our Shiny app with no problems on Safari 14.1.2, running on macOS Mojave. I am reasonably confident that the bug arrived in Safari 15, although I'm not sure exactly when, since I hadn't been working on the web-deployed version of our Shiny app in the past few months.
Sorry, I should have added: the Safari dev console throws up dozens of errors as soon as I load the page. Here is one of them (I think they are all the same, but I haven't checked every single one):
WebGL: INVALID_OPERATION: useProgram: program not valid
useProgram
useProgram
(anonymous function) — deckgl.min.js:1:26966
value — deckgl.min.js:11:704333
value — deckgl.min.js:11:124255
value — deckgl.min.js:1:309438
(anonymous function) — deckgl.min.js:1:296158
nt — deckgl.min.js:1:29116
value — deckgl.min.js:1:295834
value — deckgl.min.js:1:238971
value — deckgl.min.js:1:237512
value — deckgl.min.js:11:90595
value — deckgl.min.js:11:223270
value — deckgl.min.js:11:218515
value — deckgl.min.js:11:224007
value
value — deckgl.min.js:11:197080
value — deckgl.min.js:11:194249
e — deckgl.min.js:11:196242
deckgl.min.js:1:26966
Judging by those error logs, and the fact it runs in other browsers, this looks like it's a compatability issue between Safari and Deck.gl; have you checkd the deck.gl issue tracker to see if there's anything there?
Good suggestion; I checked their issue tracker and found discussion of a big performance regression in a previous version of Safari from the summer, but nothing more recent, and definitely nothing about maps completely failing to render.
Does a pure deck.gl-only example work for you? e.g. - https://jsfiddle.net/symbolixau/on7432fj/70/
No! The basemap loads, but the rainbow polygons do not. (All works fine in Chrome.)
I can take this over to the deck.gl side and see what they can make of it. I don't have any experience with deck.gl except via mapdeck—would you suggest I give them your example as a reasonably minimal reprex?
would you suggest I give them your example as a reasonably minimal reprex?
yes, plus the error logs should be enough to start them debugging
Great, many thanks!
After some back and forth (visgl/deck.gl#6414 (comment)), the deck.gl contributor concluded that this problem comes from mapdeck depending on an old version of deck.gl, if I understand things correctly.
I've updated the fiddle to use the latest deck.gl library; let me know if this is working for you and if so I'll update mapdeck accordingly.
ok now try the latest mapdeck
remotes::install_github("SymbolixAU/mapdeck")
Yup, my test project works just fine now!
cool - safe to close this issue?
(I probably won't get this updated on CRAN any time soon, however.)
Yup, thanks a lot!