(2023.2.x, 2023.1.x) IndexOutOfRangeException in Layout.LayoutManager.DestroyNode when changing UXML

Only in a built WebGL player, no error in editor. Switching multiple times between UXMLs within a UIDocument via UIButtons will result in a IndexOutOfRangeException generated from the InputSystem.

Repeat between x3 / x10 times to generate error (appears random, clicking speed has no incidence). Application will become unresponsible afterwards. Reproduced 100% of times.

Reproduced in 2023.2.x, 2023.1.x. Could not reproduce in 2022.x (2022.2.19 &+ LTS).
Using Chrome Version 114.0.5735.199 (Official Build) (64-bit), Windows 10 Pro Version 10.0.19045 Build 19045.

Note: Randomly, sometimes the following error will appear instead of the IndexOutOfRangeException. InvalidOperationException: Failed to Free handle with Index=0 Version=0 at UnityEngine.UIElements.

Note(2): Also posted in WebGL & InputSystem forums as I don’t know which system is at fault.

https://forum.unity.com/threads/2023-2-x-2023-1-x-indexoutofrangeexception-in-layout-layoutmanager-destroynode-when-changing-uxml.1465175/

Submitted bug report with repro project in Case: IN-49088

Thanks for the detailed report! We’ll take a look once the bug makes it to the team.

1 Like

Do you have some insight on this issue you could share? We would want to migrate our projects to 2023.x but this issue is blocking us. I know the WebGL team is investigating as well, so not sure who to poke here as there hasn’t been much movement over the last 3 months.

Thank you.

Hey, it’s still open and making its way through our backlog. A dev is assigned to it now, but no ETA yet.

1 Like

Any update on this?
This bug basically prevents updating to Unity 2023 if there are more then one ui documents in a project!

FYI - here’s what I got from Unity support about workarounds and status last week:

I also did ask;

But have not received an answer.

Any update on this? I’m also seeing impact latest 2023 version

Yes - good news; update here, https://discussions.unity.com/t/924465