Static version of R Shiny app using shinylive package failing to preload packages using webR

49 Views Asked by At

I'm trying to create a static version of my app and set it up as the Github Pages website. Here's a link to my folder containing the static version of the app created by the shinylive package https://github.com/StatsDasha/MO-E-EQI/tree/main/docs and this is the Github Pages website created https://statsdasha.github.io/MO-E-EQI/. You can see that the app is partially loading, but seems to be failing to execute a lot of the functionality of the app from (what I suspect) failing to load all the packages.

It fails with the following js console output (truncated):

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
.......

I can't really figure out why it seems that webR is failing to load any packages and it seems to have the only problem.

1

There are 1 best solutions below

0
coatless On

The "preload error: Downloading webR package: {package}" message will appear during the loading process of an r-shinylive app. It's important to note that this error does not indicate any serious issue.

During the app's loading phase, various R packages compiled for webR are downloaded into the browser session to facilitate the functioning of the shinylive app. However, the underlying webR session is configured to use the JavaScript function console.error() for both message() and warning() function calls. This setup is because these functions write messages to STDERR rather than STDOUT.

Ideally, messages generated by message() should be directed to console.log() and those from warning() to console.warn(). Only errors originating from stop() should be directed to console.error(). Hopefully that will be addressed in the future.