bevyengine/bevy · critical

Camera entity wasn't synced.

Error message

Camera entity wasn't synced.

What it means

extract_pathtracer (bevy_solari pathtracer/extract.rs:23-25) calls commands.get_entity(RenderEntity) and expects Some, relying on the invariant that every main-world camera has a synced render-world entity maintained by bevy_render's sync systems. The panic means the render entity was missing or already removed when Solari's pathtracer extract system ran — an internal sync failure, not a user API error.

Source

Thrown at crates/bevy_solari/src/pathtracer/extract.rs:25

};
use bevy_render::{sync_world::RenderEntity, Extract};
use bevy_transform::components::GlobalTransform;

pub fn extract_pathtracer(
    cameras_3d: Extract<
        Query<(
            RenderEntity,
            &Camera,
            Ref<GlobalTransform>,
            Option<&Pathtracer>,
        )>,
    >,
    mut commands: Commands,
) {
    for (entity, camera, global_transform, pathtracer) in &cameras_3d {
        let mut entity_commands = commands
            .get_entity(entity)
            .expect("Camera entity wasn't synced.");
        if let Some(pathtracer) = pathtracer
            && camera.is_active
        {
            let mut pathtracer = pathtracer.clone();
            pathtracer.reset |= global_transform.is_changed();
            entity_commands.insert(pathtracer);
        } else {
            entity_commands.remove::<(Pathtracer, PathtracerAccumulationTexture)>();
        }
    }
}

View on GitHub (pinned to 396ca72708)

Solutions

  1. Despawn cameras via commands (applied at sync boundaries) instead of immediate world despawn mid-frame
  2. Remove the Pathtracer component first and despawn the camera on a later frame
  3. Check any custom extract system ordering relative to bevy_render's sync systems
  4. Verify all bevy_* crates resolve to the same version (cargo tree), then update — if it persists, report to the Bevy repo with a minimal repro
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Despawning a camera (or invalidating its RenderEntity mapping) between world sync and the Solari extract system; custom render app schedules that reorder or skip SyncPlugin; plugins that mutate sync_world entities; mismatched Bevy crate versions in one dependency graph.

Common situations: Hot-despawning cameras while the Solari/pathtracer plugin is enabled; custom render pipelines added to the RenderApp that interfere with camera sync; nightlies or mixed versions where sync ordering changed.

Related errors


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/74d727a3a3b205b2. Report an issue: GitHub.