Closed pawelru closed 2 months ago
I think I have found a workaround of this issue. I added the following to the app code before any of library()
calls.
if (packageVersion("webr") < "0.3.0") {
.e <- as.environment("webr_shims")
.e[["library"]] <- function(pkg, ...) {
package <- as.character(substitute(pkg))
if (length(find.package(package, quiet = TRUE)) == 0) {
webr::install(package)
}
base::library(package, character.only = TRUE, ...)
}
}
Looks like the issue was in shinylive
assets. I have upgraded it to v0.5.0 (shinylive::assets_download("0.5.0")
) and I got sufficient webr version. No need to implement above workaround anymore.
Currently it is using
v0.2.2
whereas the newest is0.3.2
. The difference is quite big. For instance, I want to make use ofwebr::library_shim()
which is unavailable in thev0.2.2