shiny app not working anymore

shiny
#1

I use the shiny package to open a GUI in package QCA, which used to work just fine with shiny version 1.2, but upgrading to the latest version made the app unusable. It simply does not open anymore.

Tried to find what changed, but could not find a ChangeLog file in the shiny package on CRAN. Could anyone advise, please?

0 Likes

#2

Hi @dusadrian, there were a number of regressions introduced in shiny v1.3 and we're working hard to fix them. We'll be submitting a patch to CRAN in the next couple days, but in the meantime, you can see if the release candidate fixes your issue:

remotes::install_github("rstudio/shiny@rc-v1.3.2")
0 Likes

#3

Thanks very much for the reply, it's good to hear you are working on it. I thought my code is not in sync with the package anymore.
Just installed the latest dev version, and does not fix the issue. My app is a pure HTML one that I usually open with runApp().

0 Likes

#4

Ok, could you please provide the output of devtools::session_info() ?

Also please provide any output or errors you are seeing. If you don't see anything in your R console and see a blank web page, please right-click on the page, choose inspect element, and report any errors you see under the console tab.

If there's any chance you could share the app with us, we'd love to get to the bottom of the issue as quickly as possible.

0 Likes

#5

Oh, I see, we can replicate the issue with:

shiny::runApp(system.file("gui", package = "QCA"), launch.browser = TRUE)

We're looking into it now, stay tuned!

0 Likes

#6

Yes, of course, this is the result of session_info:

Session info ----------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.3 (2019-03-11)
 system   x86_64, darwin15.6.0        
 ui       AQUA                        
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       Europe/Bucharest            
 date     2019-04-19                  

Packages --------------------------------------------------------------------------------
 package    * version date       source        
 admisc     * 1.0     2019-04-18 local         
 base       * 3.5.3   2019-03-13 local         
 compiler     3.5.3   2019-03-13 local         
 datasets   * 3.5.3   2019-03-13 local         
 devtools     1.13.6  2018-06-27 CRAN (R 3.5.0)
 digest       0.6.16  2018-08-22 CRAN (R 3.5.0)
 fastdigest   0.6-3   2015-10-08 CRAN (R 3.5.0)
 graphics   * 3.5.3   2019-03-13 local         
 grDevices  * 3.5.3   2019-03-13 local         
 htmltools    0.3.6   2017-04-28 CRAN (R 3.5.0)
 httpuv       1.5.1   2019-04-05 CRAN (R 3.5.2)
 later        0.8.0   2019-02-11 CRAN (R 3.5.2)
 magrittr     1.5     2014-11-22 CRAN (R 3.5.0)
 memoise      1.1.0   2017-04-21 CRAN (R 3.5.0)
 methods    * 3.5.3   2019-03-13 local         
 mime         0.6     2018-10-05 CRAN (R 3.5.0)
 mylocal    * 1.0     2019-04-18 local         
 promises     1.0.1   2018-04-13 CRAN (R 3.5.0)
 QCA        * 3.4-3   2019-04-18 local         
 R6           2.3.0   2018-10-04 CRAN (R 3.5.0)
 Rcpp         1.0.1   2019-03-17 cran (@1.0.1) 
 shiny        1.3.1   2019-04-12 CRAN (R 3.5.2)
 stats      * 3.5.3   2019-03-13 local         
 utils      * 3.5.3   2019-03-13 local         
 venn         1.7     2019-04-18 local         
 withr        2.1.2   2018-03-15 CRAN (R 3.5.0)
 xtable       1.8-3   2018-08-29 CRAN (R 3.5.0)

There is nothing different in the R console than the usual:

Loading required package: shiny

Listening on http://127.0.0.1:6695

But in the web page the following happens:

# No UI defined

Shiny couldn't find any UI for this application. We looked in:

* `www/index.html`
* `ui.R`
* `app.R`

To try my app, you can simply install the QCA package from CRAN, load it and type the command:
runGUI(), which is essentially a wrapper to runApp() but automatically supplying the path to the directory where the app resides.

I hope this helps,
Adrian

0 Likes

#7

It looks like QCA was relying on some quirks of Shiny's file handling behavior. In previous versions of Shiny, it would search Shiny's shared/ directory for JS and CSS files, and if not found, it would search QCA's www/shared/ directory for those files. Shiny wasn't explicitly designed to work that way -- it just happened to work that way because of how things were implemented. The new version of Shiny (1.3.1) doesn't do fallthrough for shared/, so it only searches Shiny's shared/ directory, and not QCA's www/shared/.

We have a fix in the works here: https://github.com/rstudio/shiny/pull/2394

In general, I would suggest putting QCA's files in somewhere other than shared/. Additionally, we saw that QCA includes its own copy of shiny.js, which is general not a good idea, since some changes in Shiny's R code require changes to the JS code. I think it would simplify things if you used an HTML template, as explained in this article: https://shiny.rstudio.com/articles/templates.html

One other thing: if QCA does continue to include shiny.js, there should be license and attribution information for it included in the package.

0 Likes

#8

OK, thanks very much to you both, Carson and Winston.
The thing is I am only using shiny for its communication with R, the codebase of the app has almost nothing to do with a "normal" shiny app, or a htmlTemplate() as suggested.
It's great it was an easy fix, will stay tuned for the next rc.
Of course, will include licence and attribution for shiny.js, my apologies for the oversight.

0 Likes

#9

We've decided against including a patch for this specific issue in v1.3.2 and there's a chance we may not support it (i.e., serving of assets under www/shared) in the future.

Fortunately you can fix the issue by renaming www/shared to something else, say www/lib, as I've done here. Let me know if there is anything else I can do to make those changes on your end.

0 Likes

#10

Oh, did not realise the name "shared" would cause so much trouble.
Then renaming it should do the trick... except that I cannot make it work on my machine. Replacing the files didn't do it, and I even tried to build the entire package from your repo, with the same result.
Does the app work on your end?

0 Likes

#11

Yes, the following seems to work:

remotes::install_github("rstudio/shiny@rc-v1.3.2")
remotes::install_github("cpsievert/QCA")
# restart R sesssion
QCA::runGUI()
0 Likes

#12

Right...
It was something in my R environment, as it did not work until opening a fresh instance.
Great, thanks very much again.

0 Likes