-
Notifications
You must be signed in to change notification settings - Fork 1
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
shinylive problem #1
Comments
This helps, was cluelessly debugging shinylive apps previously. I just finished a partial workaround, but I lose the ability to persist widgets in the viewer. Should be able to add some additional Combination of debouncing my mod_df_viewer.R
control.R
So I should get a working solution that keeps the app functioning as I want so long as I flag for when the user is trying to view data using the df_viewer widget. In other instances when the user runs code with an htmlwidget (reactable, gt, ggplot, listviewer... small list for now). Another issue for another day to programmatically detect widgets, wrap them in their render function, and then rerun. Need to look more into how George is doing widgets in his R repl app, as the rerun might be unnecessary at this point. Thanks again @timelyportfolio! |
See ramnathv/htmlwidgets#487 for reference and background. @jcheng5 @seanbirchall
Debugging
shinylive
Since
MessageChannel
replaces traditional Shiny websocket (easily tracked in browser debugging tools) inshinylive
/webR
, debugging can be a little more difficult. I discoveredoptions(shiny.trace = TRUE)
in the app will log to browser console which is helpfulshinylive-inject-socket.txt
around line[https://github.com/posit-dev/shinylive/blob/main/src/assets/shinylive-inject-socket.txt#L62] by addingif(event.value && event.value.data) {console.log(JSON.parse(event.value.data))}
aftershinylive::export()
inshinylive-sw.js
provides the full streamPotential Partial Solution (at least locally for me in
shinylive
)While this helps in my local testing, I want to stress that the issue still eventually will appear if viewer is not cleared after first render. Before I was not able to get any rendered df_viewer, but it sounds like in the original issue that df_viewer would appear.
Moving lines to the end of
mod_df_viewer.R
seems to partially resolve what appears to be an asynchrony issue that happens in theshinylive
context. Oddly, when I added a line before thereq
(even a commented one) without changing the order of the code, then the problem also went away at least locally in ashinylive
context.Sean, if working correctly, you should be able to remove the manually added dependencies in lines.
Problem
The
shiny::req(ide$environment_selected, input$index, input$rows, input$columns)
in line leads to anull
data
message sent. Thenhtmlwidgets
line fails sincedata.deps
does not exist.The text was updated successfully, but these errors were encountered: