闪亮的更新Windows 10:无法从本地加载资源img src

时间:2019-04-18 12:42:12

标签: r shiny

我正在安装本地R / RStudio的Windows 10上工作。 几天后,我又将R更新到v3.5.3,并将RStudio更新到v1.2.1330。 几天后,我没有立即检查我的应用。同时,我必须安装许多Julia / Atom-Juno软件包进行培训,现在当我(本地)运行我正在开发的应用程序时,所有图像都消失了。 https://github.com/phileas-condemine/carto_indicateurs 该应用程序看起来像这样:https://drees.shinyapps.io/Cartographie_des_indicateurs/(即使是其他操作系统,我也没有尝试重新部署它

这是一个简单的代表

在app.R内(在RStudio项目中运行)

library(shiny)
download.file(url = "https://www.rstudio.com/wp-content/uploads/2019/03/RStudio-Logo-Blue-Gray-125.png",
              destfile = "www/rstudio.png",mode = "wb")#I have to add this for windows 10
shinyApp(
  ui = fluidPage(
    tags$img(src="https://www.rstudio.com/wp-content/uploads/2019/03/RStudio-Logo-Blue-Gray-125.png"),
    tags$img(src="rstudio.png")
  ),
  server = function(input, output) { }
)

本地图像无法渲染,而是图像损坏。 (我从URL中获得的一个就可以了) 当我打开Chrome检查器并检查JS控制台时,出现以下错误

Failed to load resource: the server responded with a status of 404 (Not Found) rstudio.png:1

我试图用最新的rocker / rstudio图像检查reprex,但无法重现。可能是因为它与Windows 10有关。

这是我的sessionInfo()

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=French_France.1252 
[2] LC_CTYPE=French_France.1252   
[3] LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                  
[5] LC_TIME=French_France.1252    

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

other attached packages:
[1] shiny_1.3.1

loaded via a namespace (and not attached):
 [1] compiler_3.5.3 
 [2] magrittr_1.5   
 [3] R6_2.4.0       
 [4] promises_1.0.1 
 [5] later_0.8.0    
 [6] htmltools_0.3.6
 [7] tools_3.5.3    
 [8] Rcpp_1.0.1     
 [9] jsonlite_1.6   
[10] digest_0.6.18  
[11] xtable_1.8-3   
[12] httpuv_1.5.1   
[13] mime_0.6  

我尝试重新安装R v3.5.3和最新的RStudio v1.2.1335,但无法修复。

最让我困扰的是,某些应用程序渲染了所有图像而没有任何问题。 例如,这可以正常工作:https://github.com/phileas-condemine/trafic_dataviz.drees 是因为依赖关系以某种方式解决了该问题吗?

1 个答案:

答案 0 :(得分:0)

返回闪亮1.2.0和R 3.5.2解决了该问题,所有图像均正确显示。因此,“错误”来自闪亮的1.3.1或R 3.5.3

R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=French_France.1252 
[2] LC_CTYPE=French_France.1252   
[3] LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C                  
[5] LC_TIME=French_France.1252    

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

other attached packages:
 [1] bsplus_0.1.1         
 [2] shinycssloaders_0.2.0
 [3] markdown_0.9         
 [4] stringr_1.3.1        
 [5] shinyBS_0.61         
 [6] shinydashboard_0.7.1 
 [7] shinyjs_1.0          
 [8] V8_2.2               
 [9] shinyWidgets_0.4.4   
[10] DT_0.5               
[11] data.table_1.12.0    
[12] dplyr_0.7.8          
[13] shiny_1.2.0          

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0      
 [2] pillar_1.3.1    
 [3] compiler_3.5.2  
 [4] later_0.8.0     
 [5] bindr_0.1.1     
 [6] tools_3.5.2     
 [7] digest_0.6.18   
 [8] packrat_0.5.0   
 [9] lubridate_1.7.4 
[10] jsonlite_1.6    
[11] tibble_2.0.1    
[12] pkgconfig_2.0.2 
[13] rlang_0.3.1     
[14] rstudioapi_0.9.0
[15] crosstalk_1.0.0 
[16] yaml_2.2.0      
[17] curl_3.3        
[18] bindrcpp_0.2.2  
[19] htmlwidgets_1.3 
[20] tidyselect_0.2.5
[21] glue_1.3.0      
[22] R6_2.3.0        
[23] purrr_0.3.0     
[24] magrittr_1.5    
[25] scales_1.0.0    
[26] promises_1.0.1  
[27] htmltools_0.3.6 
[28] assertthat_0.2.0
[29] mime_0.6        
[30] xtable_1.8-3    
[31] colorspace_1.4-0
[32] httpuv_1.5.1    
[33] stringi_1.2.4   
[34] munsell_0.5.0   
[35] crayon_1.3.4