Search Issue Tracker
Duplicate
Votes
0
Found in
2022.1.0b6
Issue ID
1400437
Regression
Yes
UIToolkit with UIDocument - InvalidOperationException
1. What happened
- Changing any value to any VisualElement in UIBuilder or via scripts creates an error (Invalid Operation Exception, see the stacktrace below).
2. How can we reproduce it using the example you attached
- Open the scene file
- Select UIDocument in the scene, open Test (Visual Tree Asset) so UI Builder opens up
- Do anything to any element (Label) in the tree, e.g. change opacity, position, apply any style (via editor or style script) and the error message will appear in the console
This error occours in Unity 2022.1.b5 and 2022.1.b6. No errors with 2021.2.10f1 version.
Stacktrace:
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <cdc4992cc04a4e77a24a09cd121af77b>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <cdc4992cc04a4e77a24a09cd121af77b>:0)
UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <9fb9706855a847a1926259ab0baf1b3c>:0)
UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <05a8bc2f25e84bdebc90d31147b4881d>:0)
Note: We tried on Windows and it looks like its affecting MAC only.
-
manuelgoellnitz
Mar 22, 2022 08:32
If this is a duplicate, where is the other ticket with the same bug?
A link would be nice.I have this problem on WebGL, so it seams not MAC only and on Unity 2021.2.15
-
Nanomid
Feb 24, 2022 23:05
I have this issue constantly.
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <7b935204f5ff4bcab44b3b0ebca330bf>:0)
UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <a40fb3db3ff84d2d9bf85ec84d6c5573>:0)
UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <4e881c99ae1a43bfa47861981e2726e0>:0)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Double separation lines are present in a kebab dropdown menu
- [URP] CommandBuffer: built-in render texture type 3 not found while executing warning is thrown when Game view is open and OpenGL is used
- User gets "Sorry...that page seems to be missing" when click a help icon
- Horizontal Scrollbar appears in the Inspector Window when the Volume Component is added
- Build Profiles - Feature Request: Editor restart button would improve the user experience
This is a duplicate of issue #1402588