bevyengine/bevy · critical
Camera entity wasn't synced.
Error message
Camera entity wasn't synced.
What it means
extract_solari_lighting (bevy_solari realtime/extract.rs:11-14) queries (RenderEntity, &Camera, Option<&mut SolariLighting>) from the main world and expects commands.get_entity(entity) to return Some. The panic fires when the render-world counterpart of the camera does not exist — a violation of the main/render world sync invariant maintained by bevy_render. It is an engine-level failure, not something the Solari API itself validates.
Source
Thrown at crates/bevy_solari/src/realtime/extract.rs:13
use super::{prepare::SolariLightingResources, SolariLighting};
use bevy_camera::Camera;
use bevy_ecs::system::{Commands, ResMut};
use bevy_pbr::deferred::SkipDeferredLighting;
use bevy_render::{sync_world::RenderEntity, MainWorld};
pub fn extract_solari_lighting(mut main_world: ResMut<MainWorld>, mut commands: Commands) {
let mut cameras_3d = main_world.query::<(RenderEntity, &Camera, Option<&mut SolariLighting>)>();
for (entity, camera, solari_lighting) in cameras_3d.iter_mut(&mut main_world) {
let mut entity_commands = commands
.get_entity(entity)
.expect("Camera entity wasn't synced.");
if let Some(mut solari_lighting) = solari_lighting
&& camera.is_active
{
entity_commands.insert((solari_lighting.clone(), SkipDeferredLighting));
solari_lighting.reset = false;
} else {
entity_commands.remove::<(
SolariLighting,
SolariLightingResources,
SkipDeferredLighting,
)>();
}
}
}
View on GitHub (pinned to 396ca72708)
Solutions
- Use deferred commands to despawn cameras rather than despawning during extract
- Deactivate the Camera (is_active = false) instead of despawning when toggling Solari lighting
- Review custom extract/sync system ordering against bevy_render's SyncPlugin
- Align Bevy versions and update; if reproducible, file an issue with a minimal example
Defensive patterns
Strategy: validation
Prevention
- Prefer deactivating the camera over despawning it when Solari lighting is toggled per-frame
- Do not mutate RenderEntity/sync_world mappings from game code or plugins
- Keep extract system sets unmodified when adding Solari to a custom render setup
When it happens
Trigger: A camera entity despawned or its RenderEntity mapping invalidated between sync and Solari's extract; custom render schedules that reorder extraction or sync; direct mutation of sync_world entities from plugins; mixed Bevy versions in one build.
Common situations: Toggling Solari lighting on cameras that are spawned/despawned every frame; custom RenderApp setups (custom render graphs, added extract systems); upgrading with partially updated bevy crates.
Related errors
- Camera entity wasn't synced.
- Too many light sources in the scene, maximum is 65535.
- Too many triangles ({triangle_count}) in an emissive mesh, m
- Cannot call `ReflectComponent::reflect_mut` on component {na
- Cannot call `ReflectComponent::reflect_unchecked_mut` on com
AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20).
Data as JSON: /api/errors/018f9d160d63af40.
Report an issue: GitHub.