Repository navigation
Description
I originally posted this as a Shiny bug (see rstudio/shiny#4363), and was asked to post here. This report includes the original one below, with more detail about RStudio here:
System details
RStudio Edition : Desktop
RStudio Version : 2026.01.1+403 (2026.01.1+403)
OS Version : macOS Sequoia 15.7.4
R Version : 4.5.2
Steps to reproduce the problem
- Create a small test package including the R file included below, with man page produced from it by ROxygen.
- Ask for help via
?testfn. - Click on the "Run examples" link that appears at the top of the examples.
Describe the problem in detail
This causes a blank window to pop up, and I can't find a way to close it. The console also becomes unresponsive. The only way I know to recover is to force RStudio to quit.
Describe the behavior you expected
If you run example(testfn), the Shiny app opens, and entering text in the text input field causes it to quit. This is what "run examples" should also do.
- [x ] I have read the guide for submitting good bug reports.
- [x ] I have installed the latest version of RStudio, and confirmed that the issue still persists.
- [ x] If I am reporting an RStudio crash, I have included a diagnostics report. (Attached),
- [x ] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
I put together a help page that ran a Shiny app. It works fine with example(testfn), but if I ask for help on testfn and then click on the "Run examples" link shown at the top of the examples, RStudio locks up and I can't find a way to revive it other than Force Quit.
The source for a simplified example help page is shown below. Here is my sessionInfo:
R version 4.5.2 (2025-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.7.4
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Toronto
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] shiny_1.11.1 testpkg_0.1.0
loaded via a namespace (and not attached):
[1] digest_0.6.37 later_1.4.4 R6_2.6.1
[4] httpuv_1.6.16 fastmap_1.2.0 magrittr_2.0.4
[7] cachem_1.1.0 memoise_2.0.1 htmltools_0.5.9
[10] lifecycle_1.0.5 promises_1.5.0 cli_3.6.5
[13] xtable_1.8-4 sass_0.4.10 jquerylib_0.1.4
[16] pkgload_1.4.1 compiler_4.5.2 rstudioapi_0.17.1
[19] tools_4.5.2 bslib_0.9.0 mime_0.13
[22] Rcpp_1.1.0 otel_0.2.0 rlang_1.1.7
[25] jsonlite_2.0.0
And here is the sample test page. Use Roxygen to generate the man page in a package, then ?testfn to see the help, and click on "Run examples" there to lock up RStudio.
#' @title test help example
#' @param x
#'
#' @examples
#' # Warning! Clicking on "Run examples"
#' # can crash RStudio (and other front ends?).
#' # Use
#' #
#' # example("testfn")
#' #
#' # to run safely.
#' captureVals <- function() {
#' ui <- shiny::fluidPage(
#' shiny::sidebarLayout(
#' shiny::sidebarPanel(
#' shiny::textInput("the_text", "Enter text to exit")
#' ),
#' shiny::textOutput("the_text")
#' )
#' )
#'
#' server <- function(input, output, session) {
#'
#' output$the_text <- renderText("some text")
#'
#' shiny::observe({
#' shiny::req(input$the_text)
#' shiny::stopApp(returnValue = input$the_text)
#' })
#' }
#'
#' shiny::runApp(shiny::shinyApp(ui, server))
#' }
#'
#' captureVals()
#'
#' @export
testfn <- function(x) {
"this is a test"
}
Activity
dmurdoch commentedon Mar 5, 2026
Here's the diagnostics report:
ronblum commentedon Mar 18, 2026
Moving back to the top of the pile to reproduce.
ronblum commentedon Mar 18, 2026
Using RStudio Desktop 2026.01.2+415 on Windows 11:
example(testfn)works as expected.run shiny help examples in the console instead of locking up (#17908)