Skip to content

Run shinylive::export() from QUARTO_PROJECT_ROOT path #77

@averissimo

Description

@averissimo

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

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions