When a Quarto file located in a subdirectory uses the shinylive extension, it fails to detect the root directory’s renv environment, resulting in an error indicating that shinylive is not found.
Below you find a minimal example to reproduce it.
git clone https://github.com/averissimo/shinylive-minimal_example
- cd shinylive-minimal_example
- quarto preview
Workaround:
Add a .Rprofile to the subdirectories:
if (!identical(Sys.getenv("QUARTO_PROJECT_ROOT"), "")) {
local({
old_wd <- getwd()
setwd(Sys.getenv("QUARTO_PROJECT_ROOT"))
source("renv/activate.R")
setwd(old_wd)
})
}
Screenshot of error
