{"record":{"id":"dbb392d1cf96d5f9","repo":"stride3d/stride","slug":"could-not-find-asset-0-for-bundle-1","errorCode":null,"errorMessage":"Could not find asset {0} for bundle {1}","messagePattern":"Could not find asset (.+?) for bundle (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.AssetCompiler/BundlePacker.cs","lineNumber":414,"sourceCode":"                                references.Add(chunkReference.Location);\n                            }\n                        }\n                    }\n                }\n            }\n\n            return references;\n        }\n\n        private void CollectReferences(DatabaseFileProvider databaseFileProvider, Bundle bundle, HashSet<string> assets, string assetUrl)\n        {\n            // Already included?\n            if (!assets.Add(assetUrl))\n                return;\n\n            ObjectId objectId;\n            if (!databaseFileProvider.ContentIndexMap.TryGetValue(assetUrl, out objectId))\n                throw new InvalidOperationException(string.Format(\"Could not find asset {0} for bundle {1}\", assetUrl, bundle.Name));\n\n            // Include references\n            foreach (var reference in GetChunkReferences(databaseFileProvider, ref objectId))\n            {\n                CollectReferences(databaseFileProvider, bundle, assets, reference);\n            }\n        }\n\n        private void CollectBundle(DatabaseFileProvider databaseFileProvider, ResolvedBundle resolvedBundle, string assetUrl)\n        {\n            // Check if index map contains it already (that also means object id has been stored as well)\n            if (resolvedBundle.DependencyIndexMap.ContainsKey(assetUrl) || resolvedBundle.IndexMap.ContainsKey(assetUrl))\n                return;\n\n            ObjectId objectId;\n            if (!databaseFileProvider.ContentIndexMap.TryGetValue(assetUrl, out objectId))\n                throw new InvalidOperationException(string.Format(\"Could not find asset {0} for bundle {1}\", assetUrl, resolvedBundle.Name));\n","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.AssetCompiler/BundlePacker.cs#L396-L432","documentation":"UpdateFromMember with NodeIndex.Empty means the node's root value itself is being replaced, which is forbidden for ObjectNode: an object node's value is fixed at construction and only its members/items may change. The method throws InvalidOperationException to enforce this invariant.","triggerScenarios":"Calling UpdateFromMember(newValue, NodeIndex.Empty) on an ObjectNode — i.e. internal/derived code attempting to reassign the entire object instance held by the node instead of updating a member or collection item.","commonSituations":"Custom node framework extensions or undo/redo systems that try to swap the underlying object wholesale; refactoring MemberNode-style update code onto ObjectNode without adjusting the index.","solutions":["Update individual members via their MemberNode.SetValue instead of replacing the root object.","Only call UpdateFromMember with a non-empty NodeIndex targeting a collection item.","If the whole object must be replaced, construct a new ObjectNode (or a new model) rather than mutating this one."],"exampleFix":"// before\nobjectNode.UpdateFromMember(newObject, NodeIndex.Empty);\n// after\nobjectNode.GetMember(nameof(MyType.Name)).Update(newObject.Name);","handlingStrategy":"validation","validationCode":"if (index == NodeIndex.Empty)\n    throw new InvalidOperationException(\"Use MemberNode.SetValue to change members; ObjectNode root value is fixed\");","typeGuard":"bool CanUpdateRoot(GraphNode node) => node is not ObjectNode || node is not IObjectNode { }; // ObjectNode never allows empty-index update","tryCatchPattern":"try { node.UpdateFromMember(newValue, index); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"cannot be modified\")) { /* rebuild the node or update members individually */ }","preventionTips":["Treat ObjectNode root values as immutable after construction","Update members via MemberNode APIs","Only call UpdateFromMember with a real item index"],"tags":["invalid-state","quantum","immutability"],"backgroundTag":"invalid-state-transition","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"}