[BUG] UI Toolkit - UI Builder Failed to open [...] _VisualTree.uxml asset

Hello there.

I was learning to use the UI Toolkit to create some Editor and Property Drawers.

At some point I created a USS file from the UI Toolkit window.
But changed my mind and deleted that file.

Now, the UXML in which I pressed “create USS file” cannot be edited anymore and return this error on trying to open it :

UI Builder Failed to open Assets/UXML/SerializableGauge_VisualTree.uxml asset. This may be due to invalid UXML syntax or UXML syntax the UI Builder does not yet support. Check console for details.

Additional precision : the Visual Tree is still displayed correctly on my component

Can you delete the file or open the file in a text editor and see if it has some syntax errors?

@karl_jones opened with Visual Studio. Doesn’t seem to be errors.

But I just found a fix.
Posting if anyone else have the same error :

Renaming the UXML in Unity (it made it recompile I guess ?).
=> now I can open my UXML in UIToolkit again without the error. And the reference to the deleted USS file is gone.

1 Like