bevyengine/bevy · error · ApplySceneError
The cached scene (id: , path: " ") has not been resolved…
Error message
The cached scene (id: {id:?}, path: "{path:?}") has not been resolved yet. What it means
Variant of ApplySceneError. The cached ScenePatch asset is present, but its own `resolved` field is still None — the patch has not gone through ScenePatch::resolve yet. Applying a scene whose cached layer is unresolved is rejected with UnresolvedCachedScene (id + path included).
Solutions
- Drive resolution to completion first: run ScenePatch::resolve on the cached patch before spawning scenes that include it
- Switch to queue_spawn_scene, which waits for dependencies and resolution before spawning
- In a system, filter on the patch's resolved state being Some before spawning
Example fix
// before let patch = ScenePatch::load(&server, my_scene); world.spawn_scene(resolved_scene)?; // cached patch unresolved // after let patch = ScenePatch::load(&server, my_scene); // wait until dependencies are loaded, then: patch.resolve(&server, &patches)?; world.spawn_scene(resolved_scene)?;
Defensive patterns
Strategy: retry
Validate before calling
let ready = patches
.get(&cached_handle)
.is_some_and(|p| p.resolved.is_some());
if !ready { /* skip this frame, retry next frame */ } Try / catch
match resolved.spawn(&mut world) {
Err(SpawnSceneError::ApplySceneError(ApplySceneError::UnresolvedCachedScene { id, .. })) => {
// schedule a retry after the cached patch resolves
}
_ => {}
} Prevention
- Enforce load -> resolve -> spawn ordering in all custom scene systems
- Prefer queue_spawn_scene, which handles the ordering for you
When it happens
Trigger: Spawning/applying a ResolvedScene in the same frame the cached ScenePatch was loaded, before the system that calls ScenePatch::resolve has run; or a resolve path that skips the cached patch.
Common situations: Custom spawn systems that don't respect the load-then-resolve-then-spawn ordering; race between dependency loading and spawn during scene streaming; tests that spawn immediately after load.
Related errors
- This scene has not been resolved yet and cannot be spawned…
- Attempted to include a second cached scene
- Attempted to include cached scene
- Cannot cache Scene function with arguments
- Cannot resolve scene because the asset dependency
AI-assisted analysis of bevyengine/bevy@a62cce8c05 (2026-08-20).
Data as JSON: /api/errors/8a54a5ad6b204d35.
Report an issue: GitHub.
Appendix: source
Thrown at crates/bevy_scene/src/resolved_scene.rs:642
error: Box<ApplySceneError>,
},
/// Caused when an cached scene is not present.
#[error("The cached scene (id: {id:?}, path: \"{path:?}\") does not exist.")]
MissingCachedScene {
/// The path of the cached scene.
path: Option<AssetPath<'static>>,
/// The asset id of the cached scene.
id: AssetId<ScenePatch>,
},
/// Caused when an cached scene has not been resolved yet.
#[error("The cached scene (id: {id:?}, path: \"{path:?}\") has not been resolved yet.")]
UnresolvedCachedScene {
/// The path of the cached scene.
path: Option<AssetPath<'static>>,
/// The asset id of the cached scene.
id: AssetId<ScenePatch>,
},
/// Caused when a related [`ResolvedScene`] fails to apply.
#[error(
"Failed to apply the related {relationship_type_name} Scene at index {index}: {error}"
)]
RelatedSceneError {
/// The type name of the relationship.
relationship_type_name: &'static str,
/// The index of the related scene that failed to apply.
index: usize,
/// The error that occurred when applying the related scene.
error: Box<ApplySceneError>,
},
}
/// A collection of [`ResolvedScene`]s that are related to a given [`ResolvedScene`] by a [`Relationship`].
/// Each [`ResolvedScene`] added here will be spawned as a new [`Entity`] when the "parent" [`ResolvedScene`] is spawned.
pub struct RelatedResolvedScenes {
/// The related resolved scenes. Each entry in the list corresponds to a new related entity that will be spawned with the given scene.
pub scenes: Vec<ResolvedScene>,View on GitHub (pinned to a62cce8c05)