-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rstudio Viewer window not closed on shiny::stopApp() #2033
Comments
The problem appears to be this: Line 154 in 9c3a0c8
|
Alternatively, we could decide that the fact that the app is disconnected is not privileged information and |
@jcheng5 I think using |
@vnijs, my PR fixes it, but it's too late for Shiny v1.1--we'll merge it as soon as the master branch opens back up for Shiny v1.2. In the meantime, you can work around this issue by including the following JS snippet: tags$script("$(document).on('shiny:disconnected', function() {window.parent.postMessage('disconnected', '*');});") Thanks for another great bug report! |
Wonderful! The work around works great! Thanks so much @jcheng5 |
Fix #2033: Rstudio Viewer window not closed on shiny::stopApp()
@kevinushey A while back I posted an issue/question on Rstudio Community about Rstudio Viewer (and Rstudio Window) not (always) closing when closing a shiny app. I now have a minimal reproducible example (see code below). If you start the app and click the
Stop
button the app stops and the window closes. However, if you click theRefresh
button first and then click on theStop
button the window does not close, even though the shiny app does stop. The error that pops-up fromshinyapp.js
is shown in the screen shot below.It seems that the Rstudio browser tries to reset the port when the
Refresh
button is pressed and the code inshinyapp.js
is not able to capture that.I think this might be an issue in Rstudio because I don't see it in Chrome or other browsers. I'm posting here but cc-ing @kevinushey (and @jcheng5 and @bborgesr)
This is an important issue in all my apps (e.g., radiant.data). Being able to refresh the (Rstudio) browser from code is key to (fully) (re)setting the state of an app (i.e., data, inputs, etc.) based on a previous state loaded by the user.
[Error] Unable to post message to http://127.0.0.1:4535. Recipient has origin http://127.0.0.1:25108.
The text was updated successfully, but these errors were encountered: