Open jcheng5 opened 3 months ago
I think this is due to the result
output having this line:
correct_answers.set(correct_answers.get() + 1)
This should actually start an infinite loop, as there's a circular dependency on correct_answers.get()
. If you tuck that line under a with reactive.isolate()
, the error goes away (but, BTW, the app's logic is incorrect--this is just a test of Claude 3.5 Sonnet and it didn't quite get the result()
correct).
So interesting... I told it:
It's extremely bad programming practice in Shiny to have side effects like correct_answers.set() in an output. Can you make sure side effects only appear in @reactive.Effect?
and its next version appeared to work perfectly. Although it is depending on the outputs running before the update_plate
effect, which I would really prefer it make explicit by setting a priority.
I'm getting these errors in the Shiny error dialog:
Using this app (shinylive); to repro, enter a number and hit the button: