rstudio / shiny

Easy interactive web applications with R
http://shiny.rstudio.com
Other
5.35k stars 1.87k forks source link

JSON.parse failure with JS and CSS files in shared folder #2206

Open jpabbuehl opened 5 years ago

jpabbuehl commented 5 years ago

Hi all,

I am working on Rstudio server and developing shiny application in my session. Unfortunately I am unable to render perfectly on the server, but on my local environment, it's fine.

Looking at the browser console, I can see ~10 of those error messages. Source map error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data Resource URL: http://xxx.com:9000/s/b3fa5359e5dd1f97375df/p/9000/shared/shiny.min.js Source map error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data Resource URL: http://xxx.com:9000/s/b3fa5359e5dd1f97375df/p/9000/shared/bootstrap/css/bootstrap.min.css etc...

I can access those files by typing the url in my browser, so I don't think it's an access issue. Basically it looks like JSON.parse detects any JS or CSS code in the shared folder as JSON and thus fails. Unfortunately, I am not able to provide a reproducible example, because this is an internal restricted server. But here's my sessionInfo()

R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server 7.3 (Maipo)

Matrix products: default
BLAS: /opt/R/3.4.3/lib64/R/lib/libRblas.so
LAPACK: /opt/R/3.4.3/lib64/R/lib/libRlapack.so

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

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

other attached packages:
 [1] bindrcpp_0.2.2           r2d3_0.2.2              
 [3] functional_0.6           shinycssloaders_0.2.0   
 [5] ggthemes_4.0.1           reactlog_0.1.0.9000     
 [7] conflicted_1.0.0         corrplot_0.84           
 [9] V8_1.5                   lubridate_1.7.4         
[11] shinyjs_1.0              shinydashboardPlus_0.5.0
[13] promises_1.0.1           future_1.9.0            
[15] httr_1.3.1               jsonlite_1.5            
[17] shinyWidgets_0.4.3       rlang_0.2.2             
[19] forcats_0.3.0            stringr_1.3.1           
[21] dplyr_0.7.6              purrr_0.2.5             
[23] readr_1.1.1              tidyr_0.8.1             
[25] tibble_1.4.2             ggplot2_3.0.0           
[27] tidyverse_1.2.1          DT_0.4                  
[29] magrittr_1.5             shinydashboard_0.7.0    
[31] shiny_1.1.0              here_0.1                

loaded via a namespace (and not attached):
 [1] AlignAssign_0.4.0 modelr_0.1.2      assertthat_0.2.0 
 [4] cellranger_1.1.0  yaml_2.2.0        globals_0.12.2   
 [7] pillar_1.2.2      backports_1.1.2   lattice_0.20-35  
[10] glue_1.3.0        digest_0.6.17     rvest_0.3.2      
[13] colorspace_1.3-2  htmltools_0.3.6   httpuv_1.4.5     
[16] plyr_1.8.4        pkgconfig_2.0.2   broom_0.5.0      
[19] listenv_0.7.0     haven_1.1.2       xtable_1.8-3     
[22] scales_1.0.0      later_0.7.5       styler_1.0.2     
[25] withr_2.1.2       sourcetools_0.1.7 lazyeval_0.2.1   
[28] cli_1.0.0         crayon_1.3.4      readxl_1.1.0     
[31] mime_0.5          memoise_1.1.0     nlme_3.1-137     
[34] xml2_1.2.0        rsconnect_0.8.8   tools_3.4.3      
[37] hms_0.4.2         munsell_0.5.0     compiler_3.4.3   
[40] rstudioapi_0.8    htmlwidgets_1.2   crosstalk_1.0.0  
[43] labeling_0.3      gtable_0.2.0      codetools_0.2-15 
[46] curl_3.2          rematch2_2.0.1    R6_2.2.2         
[49] knitr_1.20        bindr_0.1.1       rprojroot_1.3-2  
[52] stringi_1.2.4     parallel_3.4.3    Rcpp_0.12.19     
[55] tidyselect_0.2.4 
jpabbuehl commented 5 years ago

I have tried to run the hello world example - runExample("01_hello") I can still see this error in console, with bootstrap css Perharps a missing requirement to detect the correct type ?

jcheng5 commented 5 years ago

Is there any symptom besides those messages? Those messages appear to be the source maps failing to load, which is not expected, but also shouldn't affect the assets themselves from working. Are there other messages? Does the app fail to behave as expected?

jcheng5 commented 5 years ago

And what do the above shiny.min.js and bootstrap.min.css URLs look like if you append .map to the end of the path (e.g. shiny.min.js.map)? Do you see JSON data?