R Shiny not populating: SelectInputs, Plotly graphs, leaflet map, DT datatables

I have a Shiny app which works properly from my normal computer and also from a co-worker's computer. This is true for both viewing in the local RStudio Window as well as after the app is deployed on shinyapps.io.

I recently shuffled this app to a server computer and am experiencing issues. When I run the app in the RStudio Window the skeleton of the app properly loads, but I only can see the 'hard-coded' portions of the app (e.g. Links, some titles, boxes (shinydashboard), images, and the sidebar). What doesn't populate are the selectInputs (options typically populated from data), the saved leaflet map (.html), plotly graphs (html as well), and the DT datatables (also HTML I believe). I am not receiving any error messages when I run the app.

(The picture below should be showing some plotly graphs in the boxes, along with some selectInputs in the top box of the mainpage)

The data for the app is saved locally as .rda files and shouldn't be the reason this issue is occurring. I have one R data file that is simply Sys.time(), and that properly displays in a renderText portion on the app sidebar. When I exit the app in RStudio, all the expected data is present in the Environment pane, so I don't believe that is the issue.

If I try to open the leaflet map (.html) outside RStudio, I get an error message from IE: "Internet Explorer restricted this webpage from running scripts or ActiveX controls". I can click "Allow Blocked Content" and the map loads, although there are some minor color issues.

From my investigation it appears that HTML objects are not being properly loaded, possibly due to some security settings? I contacted IT and they were unable to offer a solution. It shouldn't be associated with any firewalls.

I am logged into the server computer as the Administrator. I updated all packages on Thursday 6/25/20)
RStudio v 4.0.2
Shiny v 1.5.0

Please let me know if any additional information would be useful. Any help is appreciated - Thanks!

Did you try it on a different browser?

By the way, if you hit Ctrl-Shirt-J in a browser you will get the javascript console, sometimes error messages appear there.

I usually put lots of "print" statements in my shiny code that write messages to the console about what's going on. It's one way of debugging, since shiny is pretty hard to debug otherwise. I know there are other debugging tools but I am too lazy to learn them!

You can use this approach to check that your files are reading correctly.

Also can you check you app's shiny log? That sometimes shows the error messages.

You could also use the shinyjs js console to print messages, this will work form the server too.

shinyApp(
    ui = fluidPage(
        shinyjs::useShinyjs() # Set up shinyjs
    ),
    server = function(input, output) {
        shinyjs::logjs("hello")
    }
)
1 Like

This is a totally unexpected fix, but I had a line in the UI that posted the leaflet map
htmlOutput('map'). Commenting that line out causes the app to work as expected both locally and after deploying to shinyapps.io.

Very strange. Thanks for your response, woodward.

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