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

Shiny app shows a blank page when re-opened with rstudioapi::viewer() #4017

Open
atusy opened this issue Mar 28, 2024 · 2 comments
Open

Shiny app shows a blank page when re-opened with rstudioapi::viewer() #4017

atusy opened this issue Mar 28, 2024 · 2 comments

Comments

@atusy
Copy link

atusy commented Mar 28, 2024

System details

Browser Version: Firefox 124.0.1 (Google Chrome 122.0.6261.94 is OK)

Output of sessionInfo():

> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] digest_0.6.33     later_1.3.2       R6_2.5.1          httpuv_1.6.13    
 [5] fastmap_1.1.1     xfun_0.41         magrittr_2.0.3    shiny_1.8.1.9000 
 [9] htmltools_0.5.7   lifecycle_1.0.4   servr_0.28        ps_1.7.5         
[13] promises_1.2.1    cli_3.6.2         processx_3.8.3    xtable_1.8-4     
[17] callr_3.7.3       compiler_4.3.2    rstudioapi_0.15.0 tools_4.3.2      
[21] mime_0.12         Rcpp_1.0.11       jsonlite_1.8.8    rlang_1.1.2 

Example application or steps to reproduce the problem

# Create Shiny App in the background
callr::r_bg(function() {
  shiny::runGadget(
    shiny::basicPage("Hello"),
    function(input, output) {},
    port = 1000
  )
})

# Open Shiny App in RStudio's viewer
# On repeat calling viewer, `2n`-th tries become blank page. `2n-1`-th tries are okay.
rstudioapi::viewer("http://127.0.0.1:1000")

Describe the problem in detail

As I have shown in the above example, viewing shiny app for the 2n-th times show blank pages...
This happens on RStudio Server on Firefox, but not on Chrome.

A similar example with servr package in the below does not show such a behavior.
So I guess there is something wrong with Shiny, but not sure...

callr::r_bg(function() {
  s = servr::create_server(port = 1001, handler = function(req) {
    list(status = 200L, body = paste("Success:", req$PATH_INFO))
  })
  while(TRUE) {
    NULL
  }
})

rstudioapi::viewer("http://127.0.0.1:1001")
@gadenbuie
Copy link
Member

Hi @atusy, thanks for the bug report! Two follow up questions:

  1. Which version of RStudio Server are you using and how are you running it?
  2. Does this issue happen with previous released versions of shiny, e.g. v1.8.0 or v1.7.5?

@atusy
Copy link
Author

atusy commented Mar 28, 2024

@gadenbuie

Thank you for the quick response. Here you go.

  1. RStudio Server: 2023.12.0 Build 369, docker
  2. Happens on various Shiny versions: dev, v1.8.1, v1.8.0, v1.7.5

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

No branches or pull requests

2 participants