shiny icon indicating copy to clipboard operation
shiny copied to clipboard

Resource file updates not detected

Open nteetor opened this issue 5 years ago • 10 comments

I am noticing updates to my JavaScript and CSS files are no longer immediately detected. Previously, I would adjust and save a resource file, call shinyApp(), and the updated version of the file would be present in the application. Now I need to restart my R session and reload shiny for the changes to get picked up. I apologize, I cannot publicly share the application where I am experiencing this bug. However, I am using a package structure and shiny::addResourcePath.

This may be related to #2388.

─ Session info ─────────────────────────
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       macOS High Sierra 10.13.6   
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2019-04-16                  
  
─ Packages ─────────────────────────────
 ! package      * version date       lib source                                  
   assertthat     0.2.1   2019-03-21 [1] CRAN (R 3.5.1)                          
   backports      1.1.3   2018-12-14 [1] CRAN (R 3.5.0)                          
   broom          0.5.1   2018-12-05 [1] CRAN (R 3.5.0)                          
   callr          3.1.1   2018-12-21 [1] CRAN (R 3.5.0)                          
   cli            1.1.0   2019-03-19 [1] CRAN (R 3.5.1)                          
   crayon         1.3.4   2017-09-16 [1] CRAN (R 3.5.0)                          
   crosstalk      1.0.0   2016-12-21 [1] CRAN (R 3.5.0)                          
   curl           3.3     2019-01-10 [1] CRAN (R 3.5.2)                          
   data.table     1.12.0  2019-01-13 [1] CRAN (R 3.5.2)                          
   desc           1.2.0   2018-05-01 [1] CRAN (R 3.5.0)                          
   devtools       2.0.1   2018-10-26 [1] CRAN (R 3.5.1)                          
   digest         0.6.18  2018-10-10 [1] CRAN (R 3.5.0)                          
   dplyr          0.8.0.1 2019-02-15 [1] CRAN (R 3.5.2)                          
   DT             0.5     2018-11-05 [1] CRAN (R 3.5.0)                          
   fs             1.2.6   2018-08-23 [1] CRAN (R 3.5.0)                          
   generics       0.0.2   2018-11-29 [1] CRAN (R 3.5.0)                          
   glue           1.3.1   2019-03-12 [1] CRAN (R 3.5.1)                          
 P heat         * 3.1.1   2019-04-12 [?] local                                   
   heatdata       0.0.1   2019-04-05 [1] Github (WHOequity/HEAT-Data@a61eefc)    
   heatmeasures   0.0.1   2019-04-05 [1] Github (WHOequity/HEAT-measures@c9765b5)
   highcharter    0.7.0   2019-01-15 [1] CRAN (R 3.5.2)                          
   htmltools      0.3.6   2017-04-28 [1] CRAN (R 3.5.0)                          
   htmlwidgets    1.3     2018-09-30 [1] CRAN (R 3.5.0)                          
   httpuv         1.5.1   2019-04-05 [1] CRAN (R 3.5.2)                          
   igraph         1.2.4   2019-02-13 [1] CRAN (R 3.5.2)                          
   jsonlite       1.6     2018-12-07 [1] CRAN (R 3.5.0)                          
   later          0.8.0   2019-02-11 [1] CRAN (R 3.5.2)                          
   lattice        0.20-38 2018-11-04 [1] CRAN (R 3.5.0)                          
   lubridate      1.7.4   2018-04-11 [1] CRAN (R 3.5.0)                          
   magrittr       1.5     2014-11-22 [1] CRAN (R 3.5.0)                          
   memoise        1.1.0   2017-04-21 [1] CRAN (R 3.5.0)                          
   mime           0.6     2018-10-05 [1] CRAN (R 3.5.0)                          
   nlme           3.1-137 2018-04-07 [1] CRAN (R 3.5.1)                          
   packrat        0.5.0   2018-11-14 [1] CRAN (R 3.5.0)                          
   pillar         1.3.1   2018-12-15 [1] CRAN (R 3.5.0)                          
   pkgbuild       1.0.2   2018-10-16 [1] CRAN (R 3.5.0)                          
   pkgconfig      2.0.2   2018-08-16 [1] CRAN (R 3.5.0)                          
   pkgload        1.0.2   2018-10-29 [1] CRAN (R 3.5.0)                          
   prettyunits    1.0.2   2015-07-13 [1] CRAN (R 3.5.0)                          
   processx       3.2.1   2018-12-05 [1] CRAN (R 3.5.0)                          
   promises       1.0.1   2018-04-13 [1] CRAN (R 3.5.0)                          
   ps             1.3.0   2018-12-21 [1] CRAN (R 3.5.0)                          
   purrr          0.3.2   2019-03-15 [1] CRAN (R 3.5.2)                          
   quantmod       0.4-13  2018-04-13 [1] CRAN (R 3.5.0)                          
   R6             2.4.0   2019-02-14 [1] CRAN (R 3.5.2)                          
   Rcpp           1.0.1   2019-03-17 [1] CRAN (R 3.5.2)                          
   remotes        2.0.2   2018-10-30 [1] CRAN (R 3.5.0)                          
   rlang          0.3.4   2019-04-07 [1] CRAN (R 3.5.2)                          
   rlist          0.4.6.1 2016-04-04 [1] CRAN (R 3.5.0)                          
   rprojroot      1.3-2   2018-01-03 [1] CRAN (R 3.5.0)                          
   rstudioapi     0.9.0   2019-01-09 [1] CRAN (R 3.5.2)                          
   sessioninfo    1.1.1   2018-11-05 [1] CRAN (R 3.5.0)                          
   shiny        * 1.3.1   2019-04-12 [1] CRAN (R 3.5.2)                          
   stringi        1.3.1   2019-02-13 [1] CRAN (R 3.5.2)                          
   stringr        1.4.0   2019-02-10 [1] CRAN (R 3.5.2)                          
   testthat       2.0.1   2018-10-13 [1] CRAN (R 3.5.0)                          
   tibble         2.1.1   2019-03-16 [1] CRAN (R 3.5.2)                          
   tidyr          0.8.2   2018-10-28 [1] CRAN (R 3.5.0)                          
   tidyselect     0.2.5   2018-10-11 [1] CRAN (R 3.5.0)                          
   TTR            0.23-4  2018-09-20 [1] CRAN (R 3.5.0)                          
   usethis        1.4.0   2018-08-14 [1] CRAN (R 3.5.0)                          
   viridisLite    0.3.0   2018-02-01 [1] CRAN (R 3.5.0)                          
   whisker        0.3-2   2013-04-28 [1] CRAN (R 3.5.0)                          
   withr          2.1.2   2018-03-15 [1] CRAN (R 3.5.0)                          
   xtable         1.8-3   2018-08-29 [1] CRAN (R 3.5.0)                          
   xts            0.11-2  2018-11-05 [1] CRAN (R 3.5.0)                          
   yaml           2.2.0   2018-07-25 [1] CRAN (R 3.5.0)                          
   yonder         0.0.5   2019-04-15 [1] Github (nteetor/yonder@f181914)         
   zoo            1.8-4   2018-09-19 [1] CRAN (R 3.5.0)                          

[1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

P ── Loaded and on-disk path mismatch.

nteetor avatar Apr 16 '19 14:04 nteetor

@schloerke and I were able to repro but only extremely intermittently. Is this consistent for you? If so, does it repro even with Chrome Developer Tools open?

jcheng5 avatar Apr 16 '19 17:04 jcheng5

The behaviour is not consistent for me, something I was discouraged to find. I am most often using FireFox and have encountered the problem while the developer tools are open.

nteetor avatar Apr 16 '19 17:04 nteetor

When it does happen, hitting Reload a second or third time doesn't fix it? We only saw it happen once or maybe twice at a time.

jcheng5 avatar Apr 16 '19 22:04 jcheng5

Hitting reload did not work. When the problem would arise I needed to restart the R session and reload in order for the changes to get picked up.

nteetor avatar Apr 17 '19 00:04 nteetor

OK, great. We suspect the browser is caching. Can you try:

  1. Holding down Shift while reloading
  2. Using the Firefox developer tools to see what response is coming back from the server for that file (or whether there's a request going out to the server at all)

jcheng5 avatar Apr 17 '19 02:04 jcheng5

Oh, that would be a simpler problem. I will try out 1. and 2. next time the issue arises.

nteetor avatar Apr 17 '19 03:04 nteetor

The hard refresh does the trick.

nteetor avatar Apr 17 '19 14:04 nteetor

Small followup, I've noticed the refresh trick does not work with the RStudio viewer.

nteetor avatar Apr 30 '19 16:04 nteetor

same issue here, a hard refresh indeed does the trick - but I am not keen on having the whole company do it

mattapel avatar Nov 15 '21 17:11 mattapel

Hi folks, @nteetor , @jcheng5 , is there any hint or trick to workaround this?

For me the only thing that reliably works to update my .css file in www folder is restarting R session, which makes the style development phase a nightmare...

GitHunter0 avatar Jan 24 '22 15:01 GitHunter0

Hi folks, @nteetor , @jcheng5 , is there any hint or trick to workaround this?

For me the only thing that reliably works to update my .css file in www folder is restarting R session, which makes the style development phase a nightmare...

@GitHunter0

I am also experiencing this issue but as it is intermittent it is hard to test. Try something like this - https://stackoverflow.com/a/7413243/6186212 - and see if it helps

ZacWarham avatar Oct 25 '22 04:10 ZacWarham

I'll take a look on it, thank you @ZacWarham. Other thing that helped me is to press Ctrl+F5 to update my browser.

GitHunter0 avatar Oct 25 '22 11:10 GitHunter0