Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Shiny Apps Greys Out and Hangs

It seems that on occasion my R Shiny app appears to grey out and hang when a user first hits the site. I believe this happens because their previous web socket connection didn’t successfully terminate and R is unable to establish a new connection. I see this error in the JS console when it happens: shinyapp.js:310 Uncaught TypeError: Cannot read property 'readyState' of null. The app works fine locally, yet when I deploy it on the cloud this issue occurs.

I am not sure if the issue is related to what is described here: https://github.com/virtualstaticvoid/heroku-buildpack-r/issues/97

like image 793
John Avatar asked Jan 19 '26 03:01

John


1 Answers

I found it difficult to debug my shiny app when it was deployed on a server like CentOS where the logs don't display everything. My solution was to try and deploy the application through shinyapps.io to debug. This way you can use RStudio to error check what's happening while loading your application online.

In my case, it was an issue with renv not being able to load packages that would load fine locally, but I wouldn't get this error in the logs trying to load the application in CentOS. I could see the error better after running rsconnect::showLogs() once it was on the shinyapps server.

like image 113
HarunCelikOtto Avatar answered Jan 21 '26 18:01

HarunCelikOtto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!