Open yonicd opened 7 years ago
potentially related to https://github.com/rstudio/shiny/issues/1125
@yonicd Is it possible to provide a simplified version of the code? It's not clear to me what exactly the question or problem is, so a more detailed explanation would also be helpful.
sorry, that is the simplest version of the problem as far as i can create one.
an explanation would be to assume that you have an eventReactive (eR1) that is conditioned on two objects. they are themselves eventReactive (eR2,eR3) and are triggered by actionButtons (aB1,aB2). until both buttons are clicked any call to eR1 will be thrown to a silent error by shiny.
does that make more sense?
Hi, I wasn't able to reproduce this, but I wasn't also entirely sure how to reproduce it. When you have a spare moment, would you please confirm this is still an issue, and if it is, perhaps elaborate on how I should reproduce?
Thanks, and sorry to take so long to get back to you.
to say the truth it been a while. I just reran the code i used in original issue comment and the error still is there. when the browser invokes try to run b()
.
> library(shiny)
> library(shinyAce)
> shinyApp(
+ ui = fluidPage(
+ sidebarPanel(
+ uiOutput('x1'),
+ uiOutput('x2')),
+ mainPanel(
+ actionButton("buttonA", "button a"),
+ actionButton("buttonB", "button b")
+
+ )
+ ),
+ server = function(input, output) {
+
+
+ a<-reactive({
+ input$buttonA
+ })
+
+ a1<-reactive({
+ input$buttonB
+ })
+
+
+ b<-eventReactive(a(),{
+ 4*5
+ })
+
+ b1<-eventReactive(a1(),{
+ 3*5
+ })
+
+
+ d<-eventReactive({
+ browser()
+ x=list(b(),b1())
+
+ },{
+ a1<-2
+ b1<-4
+ list(a1=a1,b1=b1)
+ })
+
+
+ output$x1<-renderUI({
+ layerTxt=d()$a1
+ aceEditor(outputId = 'layerAce',value=layerTxt,
+ mode = "r", theme = "chrome",
+ height = "100px", fontSize = 12,wordWrap = T)
+ })
+
+ output$x2<-renderUI({
+ themeTxt=d()$b1
+ aceEditor(outputId = 'themeAce',value=themeTxt,
+ mode = "r", theme = "chrome",
+ height = "100px", fontSize = 12,wordWrap = T)
+ })
+
+ }
+ )
Listening on http://127.0.0.1:6043
Called from: eventReactiveExpr(...)
Browse[1]> b()
Error:
Called from: value[[3L]](cond)
Thanks, I was able to see it 👍
@yonicd did you end up developing a workaround? I'm encountering the same error while trying to call an eventReactive expression while calling a module. My eventReactive expression is also dependent on two reactive variables, and I get the error while trying to call the initial eventReactive while the other reactive variables are NULL.
In the end I think I had to be really careful on how I was using the conditional vectors in evenReactive
and observeEvent
. I think at the time I was developing regexSelect which also i module based and ran into similar problems as you describe. Maybe that src code and example can help you too.
the code below has a nested eventReactive call. where buttons activate eventReactive that is then used in another one.
i get a silent error that i can only see when i step into the last eventReactive. shiny tries to solve the issue by not crashing but returning that no event was taken, which is not the case when there are 2 events i want to track.
is there a way to work around this silent error problem?