带footer的Reactable本地正常,部署到Posit Connect后异常
问题描述
开发的Shiny应用在本地运行正常,但部署到Posit Connect服务器后无法正常工作。经排查,问题出在reactable组件的footer配置项——注释该配置后,服务器上的应用即可恢复正常。
应用代码
library(shiny) library(digest) library(reactable) ui <- fluidPage( mainPanel( reactableOutput("rt") ) ) server <- function(input, output) { output$rt <- renderReactable({ rmt <- reactable(mtcars[1:3,], columns = list( mpg = colDef(footer = 'A') )) print(digest(rmt)) print(sessionInfo()) return(rmt) }) } shinyApp(ui = ui, server = server)
关键观察信息
- 本地与服务器生成的reactable对象摘要值完全一致,证明两端生成的对象无差异;
- 该服务器上其他使用相同footer配置的Shiny应用运行正常;
- 本地在RStudio IDE中使用外部浏览器运行应用无异常;
- 部署后页面右键检查元素无法看到表格代码;
- 部署方式为通过Git导入到Posit Connect;
- 使用renv进行环境管理。
本地控制台输出
[1] "7f47b0250877eacd853d20e019725e8f" R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 22631) Matrix products: default locale: [1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C LC_TIME=English_United States.utf8 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] reactable_0.4.4 digest_0.6.36 shiny_1.8.1.1 loaded via a namespace (and not attached): [1] Rcpp_1.0.12 rstudioapi_0.16.0 magrittr_2.0.3 xtable_1.8-4 R6_2.5.1 rlang_1.1.4 fastmap_1.2.0 tools_4.2.1 cli_3.6.3 jquerylib_0.1.4 withr_3.0.0 htmltools_0.5.8.1 yaml_2.3.10 lifecycle_1.0.4 [15] later_1.3.2 sass_0.4.9 htmlwidgets_1.6.4 promises_1.3.0 rsconnect_1.3.1 memoise_2.0.1 cachem_1.1.0 mime_0.12 reactR_0.6.0 compiler_4.2.1 bslib_0.7.0 jsonlite_1.8.8 httpuv_1.6.15 renv_1.0.7
服务器日志(已移除时间戳)
[1] "7f47b0250877eacd853d20e019725e8f" R version 4.2.1 (2022-06-23) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux Matrix products: default BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.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] stats graphics grDevices utils datasets methods base other attached packages: [1] reactable_0.4.4 digest_0.6.36 shiny_1.8.1.1 loaded via a namespace (and not attached): [1] Rcpp_1.0.12 withr_3.0.0 later_1.3.2 mime_0.12 [5] reactR_0.6.0 R6_2.5.1 jsonlite_1.8.8 lifecycle_1.0.4 [9] xtable_1.8-4 magrittr_2.0.3 cachem_1.1.0 rlang_1.1.4 [13] cli_3.6.3 promises_1.3.0 jquerylib_0.1.4 bslib_0.7.0 [17] tools_4.2.1 htmlwidgets_1.6.4 yaml_2.3.10 httpuv_1.6.15 [21] fastmap_1.2.0 compiler_4.2.1 memoise_2.0.1 htmltools_0.5.8.1 [25] sass_0.4.9
内容的提问来源于stack exchange,提问作者paul79
相关产品推荐
相关产品推荐

