I’m currently working on a miro Web Plugin. I created the initial code base with the create-miro-app cli and deploy it via GitHub actions to GitHub pages.
The plugin works fine at first, but suddenly stops working after some time.
In the browser console I see the following errors, right before the plugin stops working:
cmn~app.cor~2d10ec5e.bcac00ff50944884.js:2 Response by token not found .areYouAlive-9lCcpb7KdjdnlwqCSp73
followed by
Uncaught Error: processCommandFromIFrame:: iframe channel not found, plugin = <my appid>, cmd = IS_RESPONSE_FOR_SOME_COMMAND at t.processCommandFromIFrame
I think I was able to find the culprit. In my plugin I render different views in the left sidebar. So far, I started with an overview view where the user was presented with different possible actions. By clicking on a button, I called:
await miroInstance.board.ui.openLeftSidebar
from the view (which was already displayed in the left sidebar itself), replacing the overview with a new view specific for the chosen action.
My interpretation is, that some miro process was still trying to communicate to the overview view, which by that time was already gone.
Can someone from the dev team confirm this analysis?
If this is indeed the problem, what is the intended way to navigate from one view to another view within a miro plugin?
Maybe the screenshots could explain what I’m trying to achieve:
Maybe I’ll go with the classic react router navigation?
Update: I changed the navigation to a simple root component, rendering different views based on an internal component state.
Unfortunately this did not resolve the problem described in my first post.
I am completely lost :(
My newest suspicion is, that it’s my SELECTION_UPDATED event handler not being removed.
Im moved the event handler to my root component and pass the selection down. However the cleanup function of my root component is never called.
Init App will be logged whenever I open the sidebar with my plugin im miro. However “Cleanup App” is never called.
Were you able to find a solution for this? I’ve got a similar issue, but I’m just using straight HTML and JS for the interface. In my case, I’m only opening a single UI (not a multi-view setup like you describe), and it still generates the same errors you showed and stops responding to events after a few seconds...but not all the time. Sometimes it’ll keep running smoothly, other times it stops cooperating after 10-15 seconds of inactivity.