Search Issue Tracker

Fixed

Fixed in 6000.6.0a8

Under Consideration for 6000.5.X

Votes

0

Found in

6000.4.8f1

6000.5.0b9

6000.6.0a5

Issue ID

UUM-142891

Regression

No

“ArgumentException: Object that does not belong to a persisted asset cannot be set as the target of a LazyLoadReference" is thrown when changing Unsupported Selector Action and saving in UI Builder

UI Builder

-

Steps to reproduce:
1. Create new Unity project using Universal 3D Template
2. In Project window create Style Sheet (USS) Asset, call it “Test”
3. Open UI Builder window
4. Press on “” button next to “Add new selector” field
5. Select “Add Existing USS” and pick newly created “Test.uss” Asset
6. In StyleSheets, expand “Test.uss” foldout and select “VisualElement”
7. In Inspector window > Unsupported Selector Action” switch from “Error” to “Warning”
8. Press “Apply” button
9. In “UI Builder - unsaved changes detected” pop-up select “Save”
10. Save UXML file
11. Observe the Console window

Actual results: Error “ArgumentException: Object that does not belong to a persisted asset cannot be set as the target of a LazyLoadReference.” Is thrown in the Console window

Expected results: No warnings are thrown in the Console window

Reproducible with versions: 6000.4.0a1, 6000.4.8f1, 6000.5.0b9, 6000.6.0a5
Can’t test with versions: 6000.3.16f1 and lower (Different pop-up behavior)

Tested on (OS): macOS Tahoe 26.4.1

{code:java}
ArgumentException: Object that does not belong to a persisted asset cannot be set as the target of a LazyLoadReference.
UnityEngine.LazyLoadReference`1[T].set_asset (T value) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/LazyLoadReference.cs:75)
UnityEngine.LazyLoadReference`1[T].op_Implicit (T asset) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/LazyLoadReference.cs:143)
Unity.UI.Builder.BuilderDocumentOpenUXML.LoadDocument (UnityEngine.UIElements.VisualTreeAsset visualTreeAsset, UnityEngine.UIElements.VisualElement documentElement) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:712)
Unity.UI.Builder.BuilderDocument.LoadDocument (UnityEngine.UIElements.VisualTreeAsset visualTreeAsset, UnityEngine.UIElements.VisualElement documentElement, Unity.UI.Builder.ThemeStyleSheetManager themeStyleSheetManager) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Document/BuilderDocument.cs:362)
Unity.UI.Builder.BuilderToolbar.LoadDocumentInternal (UnityEngine.UIElements.VisualTreeAsset visualTreeAsset, Unity.UI.Builder.ThemeStyleSheetManager themeStyleSheetManager) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Toolbar/BuilderToolbar.cs:420)
Unity.UI.Builder.BuilderToolbar.LoadDocument (UnityEngine.UIElements.VisualTreeAsset visualTreeAsset, System.Boolean unloadAllSubdocuments, System.Boolean assetModifiedExternally, System.String assetPath, Unity.UI.Builder.ThemeStyleSheetManager themeStyleSheetManager) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Toolbar/BuilderToolbar.cs:411)
Unity.UI.Builder.BuilderToolbar.ReloadDocument () (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Toolbar/BuilderToolbar.cs:383)
Unity.UI.Builder.BuilderDocumentOpenUXML.LoadVisualTreeAsset (UnityEngine.UIElements.VisualTreeAsset newVisualTreeAsset) (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:749)
Unity.UI.Builder.BuilderDocumentOpenUXML<>c__DisplayClass89_0.<OnPostProcessAsset>b__0 () (at /Users/bokken/build/output/unity/unity/Modules/UIBuilder/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:796)
UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorApplication.cs:407)
{code}

  1. Resolution Note:

    Fixed in 6000.6.0a8

  2. Resolution Note (fix version 6000.6.0a8):

    Fixed in 6000.6.0a8

Add comment

Log in to post comment