Open kissmygritts opened 7 years ago
What version of Shiny Server are you using? shiny-server --version
if you're not sure.
Do you have any proxy servers running in front of Shiny Server, or is your browser connecting directly to it as far as you know?
shiny-server v1.5.3.838
I am running behind a nginx proxy, however the error also occurs when the nginx server is turned off.
I'm working on adding some debug/trace lines to print to the console when running.
The error is triggered when I click a button to calculate an object for display on a map. When I display points it works. When I attempt to add a geoJSON to the map the error is triggered. I am printing the object to the console when it is created to make sure it exists. I am even printing the leaflet map object to the console to see that that is created and being passed to renderLeaflet element.
The full code for the application is in this repo: https://github.com/kissmygritts/telemetR/blob/master/server.R
lfMap <- eventReactive(input$ac_UpdateMap, { ## the button is ac_UpdateMap
hr <- hr_ud()
if (input$sl_HomeRange == 'Brownian Bridge' | input$sl_HomeRange == 'Kernel Density') {
hr <- lapply(hr, function(x) geojson_json(x))
}
lflt <- leaflet() %>% addProviderTiles('Esri.WorldTopoMap',
options = providerTileOptions(attribution = NA))
if (input$sl_HomeRange == 'Display Points') {
lflt <- lflt %>% mapPoints(move_df())
} else {
shinyjs::logjs(paste(sep = ' - ', 'homerange', input$sl_HomeRange, dput(hr)))
lflt <- lflt %>% mapPolygons(hr) %>% mapPoints(move_df())
}
})
# MAP OUTPUT
output$map <- renderLeaflet({
shinyjs::logjs(paste(dput(lfMap())))
lfMap()
})
Hi, I had the same problem as you (although I wasn't using leaflet, but my own package). For me the problems disappeared when I replaced all calls to geojson_json by calls to geojson_list.
Unfortunately I don't know why geojson_json doesn't work, but at least this change makes it work :)
Regards,
Peter
I had the same issue, but seems to be fixed by this commit: https://github.com/rstudio/shiny-server-client/commit/29471965ecacded757605343fb8aee98e6e50491. If the json payload contained a newline, this error was generated. Seems to be fixed in latest shiny version (after March 27 2018)
I cannot figure out what is causing the following error in my shiny app.
shiny-server v1.5.3.838
I am running behind a nginx proxy, however the error also occurs when the nginx server is turned off.
I don't know where to begin in trying to figure out the cause of the issue either.
Obligatory it works on my machine disclaimer.