{"record":{"id":"9d29777a10b0006e","repo":"stride3d/stride","slug":"an-imembernode-was-expected-when-processing-the-path-path","errorCode":null,"errorMessage":"An IMemberNode was expected when processing the path [{path}]","messagePattern":"An IMemberNode was expected when processing the path \\[(.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets.Quantum/AssetPropertyGraph.cs","lineNumber":371,"sourceCode":"                    {\n                        index = new NodeIndex(item.Value);\n                        resolveOnIndex = true;\n                        if (currentNode is not IMemberNode memberNode) throw new InvalidOperationException($\"An IMemberNode was expected when processing the path [{path}]\");\n                        currentNode = (IAssetNode?)memberNode.Target;\n                        if (currentNode.IsReference && i < path.Elements.Count - 1)\n                        {\n                            if (currentNode is not IObjectNode objNode) throw new InvalidOperationException($\"An IObjectNode was expected when processing the path [{path}]\");\n                            currentNode = (IAssetNode?)objNode.IndexedTarget(new NodeIndex(item.Value));\n                        }\n                        break;\n                    }\n                case YamlAssetPath.ElementType.ItemId:\n                    {\n                        var ids = CollectionItemIdHelper.GetCollectionItemIds(currentNode.Retrieve());\n                        var key = ids.GetKey(item.AsItemId());\n                        index = new NodeIndex(key);\n                        resolveOnIndex = false;\n                        if (currentNode is not IMemberNode memberNode) throw new InvalidOperationException($\"An IMemberNode was expected when processing the path [{path}]\");\n                        currentNode = (IAssetNode?)memberNode.Target;\n                        if (currentNode.IsReference && i < path.Elements.Count - 1)\n                        {\n                            if (currentNode is not IObjectNode objNode) throw new InvalidOperationException($\"An IObjectNode was expected when processing the path [{path}]\");\n                            currentNode = (IAssetNode?)objNode.IndexedTarget(new NodeIndex(key));\n                        }\n                        break;\n                    }\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            // Something wrong happen, the node is unreachable.\n            if (currentNode is null)\n                return null;\n        }\n\n        return currentNode;","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets.Quantum/AssetPropertyGraph.cs#L353-L389","documentation":"ResolveObjectPath throws this InvalidOperationException when processing an ItemId path element: the current node is not an IMemberNode, so memberNode.Target cannot be taken to continue the walk. The stored path expects to descend into a member at this point, but the live node tree has a different node kind there — a stale or mismatched path.","triggerScenarios":"Resolving a YamlAssetPath with an ItemId element whose current node is not a member node: asset schema changed since the path was recorded, the path was built for a different asset type, or collection item ids were regenerated.","commonSituations":"Applying YAML diffs/overrides from an older Stride version to newer assets; manual edits to .sdt/.sdpkg YAML moving values; merging asset files where paths reference members that were renamed or removed.","solutions":["Re-record the override/diff against the current asset so paths match the live graph","Fix the asset YAML or code so the path element targets an existing member","Guard resolution with a try-pattern API or node-type checks before applying stored paths","Align asset schema versions (re-save assets in the current engine version)"],"exampleFix":"// before\nvar node = graph.ResolveObjectPath(yamlPath); // stale after rename\n// after\nif (yamlPath.Elements.First().AsMember() == \"OldName\")\n    yamlPath.Elements[0] = new YamlAssetPath.ElementMemberId(\"NewName\");\nvar node = graph.ResolveObjectPath(yamlPath);","handlingStrategy":"try-catch","validationCode":"var currentNode = graph.ResolveObjectPath(path.GetPrefix(path.Elements.Count - 1));\nbool ok = currentNode is IMemberNode;","typeGuard":"bool isMemberNode = node is IMemberNode;","tryCatchPattern":"try { var node = graph.ResolveObjectPath(path); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"IMemberNode was expected\")) { // stale path: regenerate the diff for this asset }","preventionTips":["Re-save assets in the current engine version before applying old diffs","Avoid merging asset YAML manually; use the editor's merge tooling","Regenerate collection item ids after restructuring assets"],"tags":["dotnet","stride","yaml","quantum"],"backgroundTag":"type-mismatch","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}