Hi there. We are using UI Toolkit in our game and want to build to WebGL. Previously this has all worked perfectly without issue. However all of the sudden I am getting this error in the Javascript console and it seems that UI Document don’t work / rootVisualElement is not set. However no other errors are logged so I am unsure how to proceed.
Web.framework.js:10 NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.UIElements.StyleSheets.HierarchyTraversal.Recurse (UnityEngine.UIElements.VisualElement element, System.Int32 depth) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQuery+UQueryMatcher.TraverseRecursive (UnityEngine.UIElements.VisualElement element, System.Int32 depth) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.StyleSheets.HierarchyTraversal.Traverse (UnityEngine.UIElements.VisualElement element) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQuery+UQueryMatcher.Traverse (UnityEngine.UIElements.VisualElement element) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQuery+UQueryMatcher.Run (UnityEngine.UIElements.VisualElement root, System.Collections.Generic.List`1[T] matchers) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQuery+SingleQueryMatcher.Run (UnityEngine.UIElements.VisualElement root, System.Collections.Generic.List`1[T] matchers) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQueryState`1[T].Single (UnityEngine.UIElements.UQuery+SingleQueryMatcher matcher) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.UIElements.UQueryState`1[T].First () [0x00000] in <00000000000000000000000000000000>:0
What I have already tried:
- Rolling back did nott seem to change anything
- Enabling / diisabling all ui documents (Stops the error but kinda need my ui ;))
- Clear library folder
I really hope someone has a possible solution to try! Thanks in advance.