Open gereleth opened 1 month ago
hi @gereleth, apologies you keep experiencing issues with rendering your anywidget content.
I made a change that fixes the issue you raised: https://github.com/marimo-team/marimo/pull/2620 I'm not sure if it is the right change or if there are side-effects. I'm also not sure if this change will get your library to work - I tried to run your library, but still had issues - it could be just me not able to run it, but you may know better.
Thanks, @mscolnick, that change fixed the counter example but not the bbox widget. I don't know what's going on with the disappearing image there. I guess I will wait till anywidget support in marimo matures a little.
Describe the bug
This is anywidget's counter widget example with some
console.log
s sprinkled in. If we run this in a cell in marimo 0.9.7 and click the counter button then the value briefly changes to 61 and then immediately reverts back to 60. So the button shows "count is 60" but curiously if we checkc.value
in another cell then it shows 61 - a desync between python and frontend.After the first button click the js console shows the following messages:
That third line shouldn't be there but some sort of "reset" happens in the frontend after the first button click. Subsequent clicks seem to work fine.
It looks like the "reset" is related to the assignment
c.value = 60
. If we comment out the assignment then the bug doesn't happen. If we put in multiple assignments - then we see them all get replayed after the first click. This replay of state changes definitely shouldn't happen.For context: my anywidget-based
jupyter_bbox_widget
still doesn't work in marimo after the fixes in #2506 related to binary data. And there aren't even any error messages now =). It sort of looks like a "reset" might be happening there as well because the image shows up initially but then disappears as soon as I do anything.Environment
Code to reproduce
(Run the counter widget snippet above in a marimo cell and click the counter button once. Note how the count is still displayed as 60 when it should be 61)