posit-dev / r-shinylive

https://posit-dev.github.io/r-shinylive/
Other
151 stars 16 forks source link

Failure to execute the example from the README #48

Closed srfall closed 7 months ago

srfall commented 7 months ago

If I try to setup a shinylive site just following the example from the README:

system.file("examples", "01_hello", package="shiny") |>
    fs::dir_copy("myapp", overwrite = TRUE)

shinylive::export("myapp", "site")

httpuv::runStaticServer("site/")

It fails with the following js console output:

Service Worker registered load-shinylive-sw.js:37:94
Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtools shinylive.js:21554:25
WebR is using `PostMessage` communication channel, nested R REPLs are not available. shinylive.js:31930:17
preload error:wasm streaming compile failed: TypeError: WebAssembly: Response has unsupported MIME type 'application/octet-stream' expected 'application/wasm' shinylive.js:34938:38
preload error:falling back to ArrayBuffer instantiation shinylive.js:34938:38
preload echo: shinylive.js:34937:37
preload echo:R version 4.3.0 (2023-04-21) -- "Already Tomorrow" shinylive.js:34937:37
preload echo:Copyright (C) 2023 The R Foundation for Statistical Computing shinylive.js:34937:37
preload echo:Platform: wasm32-unknown-emscripten (32-bit) shinylive.js:34937:37
preload echo: shinylive.js:34937:37
preload echo:R is free software and comes with ABSOLUTELY NO WARRANTY. shinylive.js:34937:37
preload echo:You are welcome to redistribute it under certain conditions. shinylive.js:34937:37
preload echo:Type 'license()' or 'licence()' for distribution details. shinylive.js:34937:37
preload echo: shinylive.js:34937:37
preload echo:R is a collaborative project with many contributors. shinylive.js:34937:37
preload echo:Type 'contributors()' for more information and shinylive.js:34937:37
preload echo:'citation()' on how to cite R or R packages in publications. shinylive.js:34937:37
preload echo: shinylive.js:34937:37
preload echo:Type 'demo()' for some demos, 'help()' for on-line help, or shinylive.js:34937:37
preload echo:'help.start()' for an HTML browser interface to help. shinylive.js:34937:37
preload echo:Type 'q()' to quit R. shinylive.js:34937:37
preload echo: shinylive.js:34937:37
preload error:Downloading webR package: Rcpp shinylive.js:34938:38
preload error:Downloading webR package: R6 shinylive.js:34938:38
preload error:Downloading webR package: fastmap shinylive.js:34938:38
preload error:Downloading webR package: rlang shinylive.js:34938:38
preload error:Downloading webR package: later shinylive.js:34938:38
preload error:Downloading webR package: magrittr shinylive.js:34938:38
preload error:Downloading webR package: promises shinylive.js:34938:38
preload error:Downloading webR package: httpuv shinylive.js:34938:38
preload error:Downloading webR package: mime shinylive.js:34938:38
preload error:Downloading webR package: jsonlite shinylive.js:34938:38
preload error:Downloading webR package: xtable shinylive.js:34938:38
preload error:Downloading webR package: base64enc shinylive.js:34938:38
preload error:Downloading webR package: digest shinylive.js:34938:38
preload error:Downloading webR package: ellipsis shinylive.js:34938:38
preload error:Downloading webR package: htmltools shinylive.js:34938:38
preload error:Downloading webR package: fontawesome shinylive.js:34938:38
preload error:Downloading webR package: sourcetools shinylive.js:34938:38
preload error:Downloading webR package: crayon shinylive.js:34938:38
preload error:Downloading webR package: withr shinylive.js:34938:38
preload error:Downloading webR package: commonmark shinylive.js:34938:38
preload error:Downloading webR package: glue shinylive.js:34938:38
preload error:Downloading webR package: cachem shinylive.js:34938:38
preload error:Downloading webR package: jquerylib shinylive.js:34938:38
preload error:Downloading webR package: cli shinylive.js:34938:38
preload error:Downloading webR package: lifecycle shinylive.js:34938:38
preload error:Downloading webR package: memoise shinylive.js:34938:38
preload error:Downloading webR package: fs shinylive.js:34938:38
preload error:Downloading webR package: rappdirs shinylive.js:34938:38
preload error:Downloading webR package: sass shinylive.js:34938:38
preload error:Downloading webR package: bslib shinylive.js:34938:38
preload error:Downloading webR package: codetools shinylive.js:34938:38
preload error:Downloading webR package: renv shinylive.js:34938:38
preload error:Downloading webR package: shiny shinylive.js:34938:38
Robj construction for this JS object is not yet supported shinylive.js:34794:19 

Starting the shiny app via runApp("myapp") works as expected.

Any idea what could be going wrong here?

> shinylive::assets_info()
shinylive R package version:  0.1.1
shinylive web assets version: 0.2.3

> sessionInfo()
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default
...
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
 [1] compiler_4.3.2   magrittr_2.0.3   R6_2.5.1         cli_3.6.2
 [5] promises_1.2.0.1 later_1.3.1      Rcpp_1.0.11      jsonlite_1.8.8
 [9] httpuv_1.6.14    rlang_1.1.3
srfall commented 7 months ago

Ok nevermind. I just tried it again and it works. I have not changed anything, so I have no idea why it works now. Note that the js console output is basically the same, it displays all the preload errors, the only thing that is now missing is the Robj construction for this JS object is not yet supported at the end.