Serialization error with VisualElements

I am getting an error in my custom editor window ‘DialogueGraph’ telling me that VisualElementCreation is not allowed to be called during serialization. Any visual elements that I am creating are being done in OnEnable() so I am confused as to why I am getting this error. Everything does work as it’s supposed to though.

I did have the same error in another class but I was able to fix it by removing the serialized field referencing my GraphView even though that value was never actually set anywhere. So this led me to believe that it could be a serialized field in my editor window but even if I remove any serialized fields, I still get the error.

UnityException: VisualElementCreation is not allowed to be called during serialization, call it from OnEnable instead. Called from ScriptableObject ‘DialogueGraph’.
See “Script Serialization” page in the Unity Manual for further details.
UnityEngine.UIElements.VisualElement…ctor () (at <107446276b724792a53cd389e03a278b>:0)
UnityEditor.Experimental.GraphView.GraphElement…ctor () (at :0)
UnityEditor.Experimental.GraphView.Node…ctor (System.String uiFile) (at :0)
UnityEditor.Experimental.GraphView.Node…ctor () (at :0)
ModernDialogues.Editor.DialogueNode…ctor () <0x148fa5a3690 + 0x00052> in <1ef617d1ccbe42f4bcdc4736f159f636>:0

Did you fix it? I’m also encountering this issue and have no idea how to procede.