UI content lost when chainging uss file

Hi there.

I am programming a dynamic graph chart using the vector api. It is intended to be a part of my asset Graph and Chart
After i edit my uss file (in runtime) , i am getting the following warning :

UI was recreated and no companion MonoBehaviour found, some UI functionality may have been lost.
UnityEngine.UIElements.UIElementsRuntimeUtilityNative:UpdateRuntimePanels ()

The chart disappears after a second or two.

I could not find any documentation of what this warning means. Can you help ?

Some additional details:

I have a monobehaviour that has a UIDocument and id as a parameter:
9403985--1316462--upload_2023-10-11_23-30-30.png
I then obtain the visual element using the Query method:

And finally add the graph visual element under it:

GraphLineVisualElement uses the vector api by hooking generateVisualContent

Thanks.

You need to create a custom script that recreates your ui inside onenable and attach it on the same object as the UIDocument. The error you are seeing is the UIDocument complaining that there is no script alongside it.

As to why the entire UI gets recreated on a style change? Because fuck you that’s why lmao

Thanks , it worked !