{"record":{"id":"b2d911d6b6b5c3d5","repo":"bevyengine/bevy","slug":"expected-bundle-to-be-named-struct-or-tuple","errorCode":null,"errorMessage":"expected bundle `{}` to be named struct or tuple","messagePattern":"expected bundle `(.+?)` to be named struct or tuple","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/src/reflect/bundle.rs","lineNumber":173,"sourceCode":"                let bundle = entity.world_scope(|world| {\n                    from_reflect_with_fallback::<B>(reflected_bundle, world, registry)\n                });\n                entity.insert(bundle);\n            },\n            apply: |mut entity, reflected_bundle, registry| {\n                if let Some(reflect_component) =\n                    registry.get_type_data::<ReflectComponent>(TypeId::of::<B>())\n                {\n                    reflect_component.apply(entity, reflected_bundle);\n                } else {\n                    match reflected_bundle.reflect_ref() {\n                        ReflectRef::Struct(bundle) => bundle\n                            .iter_fields()\n                            .for_each(|(_, field)| apply_field(&mut entity, field, registry)),\n                        ReflectRef::Tuple(bundle) => bundle\n                            .iter_fields()\n                            .for_each(|field| apply_field(&mut entity, field, registry)),\n                        _ => panic!(\n                            \"expected bundle `{}` to be named struct or tuple\",\n                            // FIXME: once we have unique reflect, use `TypePath`.\n                            DebugName::type_name::<B>(),\n                        ),\n                    }\n                }\n            },\n            apply_or_insert_mapped: |entity,\n                                     reflected_bundle,\n                                     registry,\n                                     mapper,\n                                     relationship_hook_mode| {\n                if let Some(reflect_component) =\n                    registry.get_type_data::<ReflectComponent>(TypeId::of::<B>())\n                {\n                    reflect_component.apply_or_insert_mapped(\n                        entity,\n                        reflected_bundle,","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/src/reflect/bundle.rs#L155-L191","documentation":"Panic in ReflectBundleFns::from_reflect (insert path): dynamic reflection produced a bundle value whose ReflectRef shape is neither Struct nor Tuple (e.g. a Map/List or a unit), so its fields cannot be applied field-wise onto the entity. The message names the offending bundle type.","triggerScenarios":"Thrown at crates/bevy_ecs/src/reflect/bundle.rs:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the reflected data deserializes into the bundle's Struct/Tuple shape (e.g. via ReflectDeserializer to the bundle type)","Register and construct the bundle type itself rather than a dynamic proxy","Handle the dynamic value with from_reflect_with_fallback on the concrete bundle type"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}