使用shinylive包的R Shiny应用程序的静态版本无法使用webR预加载包

问题描述 投票:0回答:1

我正在尝试创建应用程序的静态版本并将其设置为 Github Pages 网站。这是我的文件夹的链接,其中包含由shinylive包创建的应用程序的静态版本https://github.com/StatsDasha/MO-E-EQI/tree/main/docs这是创建的Github Pages网站 https://statsdasha.github.io/MO-E-EQI/。您可以看到该应用程序正在部分加载,但似乎无法执行该应用程序的许多功能,因为(我怀疑)未能加载所有包。

它失败并显示以下 js 控制台输出(已截断):

load-shinylive-sw.js:37 Service Worker registered
shinylive.js:21554 Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools
shinylive.js:31930 WebR is using `PostMessage` communication channel, nested R REPLs are not available.
Xs @ shinylive.js:31930
shinylive.js:34937 preload echo:
shinylive.js:34937 preload echo:R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
shinylive.js:34937 preload echo:Copyright (C) 2023 The R Foundation for Statistical Computing
shinylive.js:34937 preload echo:Platform: wasm32-unknown-emscripten (32-bit)
shinylive.js:34937 preload echo:
shinylive.js:34937 preload echo:R is free software and comes with ABSOLUTELY NO WARRANTY.
shinylive.js:34937 preload echo:You are welcome to redistribute it under certain conditions.
shinylive.js:34937 preload echo:Type 'license()' or 'licence()' for distribution details.
shinylive.js:34937 preload echo:
shinylive.js:34937 preload echo:R is a collaborative project with many contributors.
shinylive.js:34937 preload echo:Type 'contributors()' for more information and
shinylive.js:34937 preload echo:'citation()' on how to cite R or R packages in publications.
shinylive.js:34937 preload echo:
shinylive.js:34937 preload echo:Type 'demo()' for some demos, 'help()' for on-line help, or
shinylive.js:34937 preload echo:'help.start()' for an HTML browser interface to help.
shinylive.js:34937 preload echo:Type 'q()' to quit R.
shinylive.js:34937 preload echo:
shinylive.js:34938 preload error:Downloading webR package: Rcpp
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: R6
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: fastmap
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: rlang
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: later
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: magrittr
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: promises
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: httpuv
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: mime
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: jsonlite
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: xtable
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: base64enc
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: digest
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: ellipsis
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: htmltools
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: fontawesome
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: sourcetools
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: crayon
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: withr
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: commonmark
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: glue
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: cachem
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: jquerylib
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: cli
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: lifecycle
_error @ shinylive.js:34938
shinylive.js:34938 preload error:Downloading webR package: memoise
.......

我真的不明白为什么 webR 似乎无法加载任何包,而且它似乎是唯一的问题。

r shiny github-pages r-shinylive
1个回答
0
投票

r-shinylive 应用程序加载过程中将出现

"preload error: Downloading webR package: {package}"
消息。请务必注意,此错误并不表示有任何严重问题。

在应用程序的加载阶段,为 webR 编译的各种 R 包被下载到浏览器会话中,以促进shinylive应用程序的运行。但是,底层 webR 会话配置为使用 JavaScript 函数

console.error()
进行
message()
warning()
函数调用。这种设置是因为这些函数将消息写入
STDERR
而不是
STDOUT

理想情况下,由

message()
生成的消息应定向到
console.log()
以及从
warning()
console.warn()
的消息。只有源自
stop()
的错误才应定向到
console.error()
。希望将来能解决这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.