From d08a2507fa4e51860ea136f96074bf87013cdc42 Mon Sep 17 00:00:00 2001 From: Jonathan McPherson Date: Thu, 24 Apr 2014 15:28:07 -0700 Subject: [PATCH] fail when attempting to insert a shiny app into a cached chunk --- R/app.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/app.R b/R/app.R index 786c914eb..2ae2660c3 100644 --- a/R/app.R +++ b/R/app.R @@ -240,6 +240,8 @@ knit_print.shiny.appobj <- function(x, ...) { "Shiny applications not supported in static R Markdown documents") } else { + if (isTRUE(as.logical(knitr::opts_current$get("cache")))) + stop("Shiny applications cannot be used in cached chunks.") path <- addSubApp(x) output <- tags$iframe(src=path, width=width, height=height, class="shiny-frame")