Skip to content

Shiny app window orphaned #17439

Closed
Closed

Description

@dataspun

System details

RStudio 2026.01.2+418 "Apple Blossom" Release (1d903d3, 2026-03-25) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2026.01.2+418 Chrome/140.0.7339.249 Electron/38.7.2 Safari/537.36, Quarto 1.8.25

Steps to reproduce the problem

  1. Open a runnable R-Shiny script, in this case app-run.R
  2. Click the Run App button with Run in Window option checked
  3. Attempt to close the window after app loads
  4. Observe the window will not close, it will gray out but will not close or refresh regardless of any subsequent action except for quitting RStudio

Describe the problem in detail

Using app-run.R one-liner shiny::runApp() with the UI options Run in Window and Run in R Console both checked, the resulting window cannot be closed after stopping app (from window or console), or even after closing project and re-opening a different project. The window is grayed out like any disconnected shiny app, in the latter example showing a completely different app, but the window will not close unless RStudio is quit. Moreover, after stopping the app and then running again, the window does not refresh out of its gray/disconnected status indicating that it's orphaned somehow. The only way to interact with the running app is to use Open in Browser from the inactive window.

Describe the behavior you expected

I would expect some method (or any combination of methods) to close app window without resorting to quit Rstudio -- most especially clicking X on any window should always result in a window closing. I would also expect the window to reflect current state of current app -- grayed out if stopped, not grayed out if running, always for the currently loaded app.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Apr 20, 2026
  2. ronblum commented on Apr 22, 2026

    @ronblum
    Contributor

    @dataspun Thank you for raising the issue! I'm unable to reproduce, though, in the same environment. A few things:

    1. Does the window close properly if you close it while the app is running?
    2. Does this happen with any Shiny app, such as even with the default app?
    3. Just to be precise, you mention app-run.R. Do you mean app.R or is this intentionally a different name?
  3. added
    info needed
    on Apr 22, 2026
  4. dataspun commented on Apr 22, 2026

    @dataspun
    Author

    @ronblum thanks for following up.

    1. No, the window won't close under any condition tested thus far. Clicking the X just grays out (deactivates) the window.
    2. It happens with every Shiny app I've tried on Windows and Mac -- not sure what the default app is
    3. Intentionally app-run.R because it plays nicely with Positron and VS Code shiny extension. But even with global.R or server.R the outcome is the same. That is, clicking Run App button with Window option checked leads to an orphaned window after initial attempt to stop/close.
  5. changed the title [-]Shiny app-run window orphaned[/-] [+]Shiny app window orphaned[/+] on Apr 22, 2026
  6. ronblum commented on Apr 23, 2026

    @ronblum
    Contributor

    @dataspun Thanks! A few more things:

    1. Can you provide a copy of the logs? You can find them with Help -> Diagnostics -> Show Logs.
    2. What version of shiny are you using? I want to set my environment as close as possible to yours.
    3. Do you recall the last version of RStudio in which this worked correctly?
    4. We released a new version of RStudio yesterday, 2026.04.0+526 Globemaster Allium. Not promising that the problem will gone, but it's always a possibility.
  7. dataspun commented on Apr 24, 2026

    @dataspun
    Author

    @ronblum

    1. snippet from logs provided below
    2. using shiny version 1.13.0 CRAN
    3. no recollection of precise version that did not have this issue, likely in the 2024/2025 release window
    4. running latest version now, same issues described above

    "Globemaster Allium" Release (57f8932, 2026-04-18) for macOS
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2026.04.0+526 Chrome/142.0.7444.265 Electron/39.8.7 Safari/537.36, Quarto 1.9.36

    rdesktop.log

    2026-04-24T05:31:11.335Z ERROR Received callback desktop_allow_navigation from unknown window
    2026-04-24T05:31:11.337Z ERROR IpcError: desktop_allow_navigation: Error invoking remote method 'desktop_allow_navigation': Error: Received callback desktop_allow_navigation from unknown window

    rsession-user.log

    2026-04-24T05:29:00.909979Z [rsession-user] ERROR system error 2 (No such file or directory) [path: /Users/user/project/app/DESCRIPTION]; OCCURRED AT Error rstudio::core::r_util::RPackageInfo::read(const FilePath &) src/cpp/core/r_util/RPackageInfo.cpp:77; LOGGED FROM: void rstudio::session::projects::ProjectContext::updatePackageInfo() src/cpp/session/projects/SessionProjectContext.cpp:975

  8. ronblum commented on Apr 24, 2026

    @ronblum
    Contributor

    @dataspun Thanks! And darn, but was worth a shot. OK--I'll mark this for review.

  9. removed
    info needed
    new
    on Apr 24, 2026
  10. added theissue type on Apr 27, 2026
  11. ronblum commented on May 4, 2026

    @ronblum
    Contributor

    See also #17502 for another example of this.

  12. added this to the Blue Plumbago milestone on May 6, 2026
  13. self-assigned this
    on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions