Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems installing/mounting package #408

Open
richardjtelford opened this issue Apr 9, 2024 · 1 comment
Open

problems installing/mounting package #408

richardjtelford opened this issue Apr 9, 2024 · 1 comment
Labels
question Further information is requested

Comments

@richardjtelford
Copy link

I have made a package containing shiny apps that I want to add to a quarto document using shinylive-r and webr. I think I have managed to get the package to compile to a library.data file with github actions.

The problem I'm having is having is to install the package in webr.

I tried using webr::mount() but my browser tab crashed with this code

webr::mount("/my-library", "https://github.com/biostats-r/shinystats/releases/download/v0.2/library.data")
.libPaths(c(.libPaths(), "/my-library"))

Then I tried webr::install()

webr::install("shinystats", repo = "https://github.com/biostats-r/shinystats/releases/download/v0.2/library.data")

This gave me the message "Not Found" after a couple of minutes.

I wonder if I have not managed to deploy correctly on github, but the file url works.

I'm also not understanding the advantages/disadvantages of mount() vs install()

@georgestagg
Copy link
Member

We will soon release an update for shinylive-r that will handle this situation automatically by downloading the Wasm binaries attached to your R package's v0.2 release from GitHub and distributing it alongside your Shiny app.

In the meantime, you will need to use a slightly different Github Action to build a CRAN-like repo rather than building and releasing a Wasm filesystem image. With this method, you will use install() rather than mount().

There are instructions in the rwasm documentation at Setting up the GitHub repository that walk you through setting up a new GitHub repository to contain your CRAN-like repo, where you can add your custom R package as part of a list of packages provided by the repo.

Alternatively, there are some community-provided tutorials at https://github.com/coatless-tutorials/webr-unified-gh-workflow working though a similar process to build and serve a CRAN-like repository for you package.


The process of using filesystem images and using mount() has the advantage that it is more efficient, but the disadvantage that it requires more control over your static server and deployment process than currently provided by shinylive-r and GitHub Pages. As I mentioned above, we're currently working on improving the situation so that this is no longer a problem, but for the moment using the install() method is simpler to implement for your app.

@georgestagg georgestagg added the question Further information is requested label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants