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

When I access R shiny with IE, plotly is not displayed. #1605

Closed
ToshihiroIguchi opened this issue Aug 24, 2019 · 5 comments
Closed

When I access R shiny with IE, plotly is not displayed. #1605

ToshihiroIguchi opened this issue Aug 24, 2019 · 5 comments

Comments

@ToshihiroIguchi
Copy link

When I start shiny by specifying host and port with runApp on Windows10 Home 32bit and access with IE11, there is a problem that the plotly graph is not displayed for the first time.
The version used was R 3.6.0, shiny 1.3.2, plotly 4.9.0.

However, it was displayed when IE was reloaded.

Also, if you start shiny after changing host or port with runApp, the plotly graph will not be displayed for the first time.

Below is the code used to start ui.R and server.R.

ui.R

library(shiny)

shinyUI(fluidPage(
  titlePanel("test"),
  plotlyOutput("plt")
))

server.R

library(shiny)
library(plotly)

shinyServer(function(input, output) {
  output$plt <- renderPlotly({plot_ly()})
})

It started with the following code.

ipconfig.dat <- system("ipconfig", intern = TRUE)
ipv4.dat <- ipconfig.dat[grep("IPv4", ipconfig.dat)][1]
ip <- gsub(".*? ([[:digit:]])", "\\1", ipv4.dat)
shiny::runApp(launch.browser = FALSE, port = 8080, host = ip)

In addition, the image file of the screenshot when accessing the first time and the third time with IE11 is attached.

The same problem occurred when launching shiny on Windows 10 Pro 64bit.
The same problem occurred when accessing with Edge.
However, this problem did not occur when accessed via Chrome.

Is it possible to display plotly graphs from the first time even when accessing with IE11?

IE_1st
IE_3rd

@cpsievert
Copy link
Collaborator

cpsievert commented Aug 28, 2019

Interesting, thanks, I was able reproduce. When you right-click -> "Inspect" -> Console, do you see an error similar to this one?

Screen Shot 2019-08-28 at 4 43 40 PM

@wch @jcheng5 I'm pretty sure this server error will occur for any htmlwidget that uses the dependencies argument of htmlwidgets::createWidget(). Here's another example based on leaflet:

library(shiny)
library(leaflet)

ui <- fluidPage(
  titlePanel("test"),
  leafletOutput("plt")
)

server <- function(input, output) {
  output$plt <- renderLeaflet({
    l <- leaflet()
    l$dependencies <- crosstalk::crosstalkLibs()
    l
  })
}

shinyApp(ui, server)

Note that you may want to disable caching in order to reliably reproduce

@cpsievert

This comment has been minimized.

@ToshihiroIguchi
Copy link
Author

Interesting, thanks, I was able reproduce. When you right-click -> "Inspect" -> Console, do you see an error similar to this one?

The error of the same content was confirmed in the console of Edge.
The screenshot image I attached has a message written in Japanese, but it is almost the same as the English message you attached.
The SCRIPT1004 error was also displayed.

edge_console

Nothing was displayed on the IE11 console.
This also attaches an image.

console

In addition, the graph is displayed if the port number is the same as the previous time, so I changed it to another port number.

@cpsievert
Copy link
Collaborator

It appears this issue was introduced by shiny v1.3.0, specifically this pull request rstudio/shiny#2280, which changed the way static files are served (using a background thread instead of the main R thread)

@cpsievert
Copy link
Collaborator

Fixed in rstudio/httpuv#239

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

No branches or pull requests

2 participants