Error when applying filter in React application


#1

I’ve a prototype of a dashboard that is build in React. I have several visualizations in the dashboard and several controls to manage and apply different filters using the Interaction Manager api. The application also has an administration panel that also contains 2 visualizations.

When I’m in the dashboard everything works ok, filters, slicers…etc. Then I move to the admin panel, to enable a couple of options. When I come back to the dashboard and apply any filter, I get this error:

48%20PM

I also get a different error below the one above.

39%20PM.

I don’t know what is going on exactly that’s why I’m not posting any visualization code here. Is there anything that ring any bells here?


#2

I’ve seen these before. If is the same case it means that a filter is being applied to a visualization that doesn’t exists, or is out of context. This usually should not happen, but probably the visualization has some event that was not removed and is still being called. Can you share part of the code of one of your visuals in the admin panel?


#3

Hi @eduardo, thanks so much. Actually with what you told me I could realize what the problem was. It turns out that the two visualizations from the admin panel were active when it was closed. The problem was with one of them where I had an execute:stop event attached that was still called. And of course some variables were not anymore in the unmounted component. I just had to validate that those objects are not undefined when leaving the app and problem solved!


#4

Even better if in addition to your validation, you can remove the visualization when unmounting the component as @gen_dev pointed here.