bevyengine/bevy · error
`{}` did not implement `Reflect`
Error message
`{}` did not implement `Reflect` What it means
Panic in apply_field: a bundle field being applied is only a PartialReflect (try_as_reflect returned None), so its concrete TypeId cannot be obtained to look up ReflectComponent/ReflectBundle registration. The field's dynamic representation does not carry the Reflect data needed for entity application.
Source
Thrown at crates/bevy_ecs/src/reflect/bundle.rs:240
),
}
}
},
remove: |entity| {
entity.remove::<B>();
},
take: |entity| {
entity
.take::<B>()
.map(|bundle| Box::new(bundle).into_reflect())
},
})
}
}
fn apply_field(entity: &mut EntityMut, field: &dyn PartialReflect, registry: &TypeRegistry) {
let Some(type_id) = field.try_as_reflect().map(Any::type_id) else {
panic!(
"`{}` did not implement `Reflect`",
field.reflect_type_path()
);
};
if let Some(reflect_component) = registry.get_type_data::<ReflectComponent>(type_id) {
reflect_component.apply(entity.reborrow(), field);
} else if let Some(reflect_bundle) = registry.get_type_data::<ReflectBundle>(type_id) {
reflect_bundle.apply(entity.reborrow(), field, registry);
} else {
panic!(
"no `ReflectComponent` nor `ReflectBundle` registration found for `{}`",
field.reflect_type_path()
);
}
}
fn apply_or_insert_field_mapped(
entity: &mut EntityWorldMut,View on GitHub (pinned to 396ca72708)
Solutions
- Ensure the field's type implements Reflect (not just PartialReflect) and is registered
- Convert dynamic field data into the concrete type with from_reflect before applying
- Handle the None case of try_as_reflect with a fallback path instead of panicking
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at crates/bevy_ecs/src/reflect/bundle.rs:240 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20).
Data as JSON: /api/errors/a41b9041ac41978f.
Report an issue: GitHub.