posit-dev / r-shinylive

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

shiny::includeMarkdown() breaks shiny live #127

Open rbcavanaugh opened 2 months ago

rbcavanaugh commented 2 months ago

I'm trying to include some additional markdown text in a basic shiny live website. However, adding a bit of text using shiny::includeMarkdown() results in a blank white page in both Safari and Chrome. Inspecting the HTML shows an empty page:

image

See minimal example here: https://github.com/rbcavanaugh/shinylive-issue, where shinylive-start.R holds these two lines to run the app.

shinylive::export(here::here(), here::here("site"))
httpuv::runStaticServer("site/")

The Old Faithful app works fine per the example code (comment out the includeMarkdown() on app.R line 21.

Thanks!

georgestagg commented 2 weeks ago

It looks like the shiny::includeMarkdown() function is re-exporting htmltools::includeMarkdown(), which itself is calling out to markdown::mark(). Since markdown is listed only as a "Suggests" dependency of htmltools, it is not being downloaded by webR as your app starts up.

Please can you try manually installing the markdown package near the start of your app.R source, and then re-exporting?

library(shiny)
webr::install("markdown")