{"record":{"id":"789b367a1e34bdf1","repo":"bevyengine/bevy","slug":"the-cached-scene-id-id-path-path-do","errorCode":null,"errorMessage":"The cached scene (id: {id:?}, path: \"{path:?}\") does not exist.","messagePattern":"The cached scene \\(id: (.+?), path: \"(.+?)\"\\) does not exist\\.","errorType":"exception","errorClass":"ApplySceneError","httpStatus":null,"severity":"error","filePath":"crates/bevy_scene/src/resolved_scene.rs","lineNumber":624,"sourceCode":"    },\n}\n\n/// An error produced when applying a [`ResolvedScene`].\n#[derive(Error, Debug)]\npub enum ApplySceneError {\n    /// Caused when a [`Template`] fails to build\n    #[error(\"Failed to build a Template in the current Scene: {0}\")]\n    TemplateBuildError(BevyError),\n    /// Caused when the cached [`ResolvedScene`] fails to apply a [`ResolvedScene`].\n    #[error(\"Failed to apply the cached Scene (asset path: \\\"{cached:?}\\\"): {error}\")]\n    CachedSceneApplyError {\n        /// The asset path of the cached scene that failed to apply.\n        cached: Option<AssetPath<'static>>,\n        /// The error that occurred while applying the cached scene.\n        error: Box<ApplySceneError>,\n    },\n    /// Caused when an cached scene is not present.\n    #[error(\"The cached scene (id: {id:?}, path: \\\"{path:?}\\\") does not exist.\")]\n    MissingCachedScene {\n        /// The path of the cached scene.\n        path: Option<AssetPath<'static>>,\n        /// The asset id of the cached scene.\n        id: AssetId<ScenePatch>,\n    },\n    /// Caused when an cached scene has not been resolved yet.\n    #[error(\"The cached scene (id: {id:?}, path: \\\"{path:?}\\\") has not been resolved yet.\")]\n    UnresolvedCachedScene {\n        /// The path of the cached scene.\n        path: Option<AssetPath<'static>>,\n        /// The asset id of the cached scene.\n        id: AssetId<ScenePatch>,\n    },\n    /// Caused when a related [`ResolvedScene`] fails to apply.\n    #[error(\n        \"Failed to apply the related {relationship_type_name} Scene at index {index}: {error}\"\n    )]","sourceCodeStart":606,"sourceCodeEnd":642,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_scene/src/resolved_scene.rs#L606-L642","documentation":"Variant of ApplySceneError. The ResolvedScene references a cached ScenePatch by AssetId, but that asset is not present in the Assets<ScenePatch> collection at apply time — i.e. the handle exists but the asset behind it was never loaded, failed to load, or was removed.","triggerScenarios":"Applying a ResolvedScene whose included cached scene handle dangles: the ScenePatch asset was unloaded (Assets::remove / AssetServer::free_unused_assets) or its load failed before resolve.","commonSituations":"Holding a ResolvedScene across frames while hot-reloading or asset unloading evicts the cached patch; failed disk load of the .scn/ron asset going unnoticed; asset server configured without the scene's source directory.","solutions":["Check the cached ScenePatch handle's LoadState before spawning; log and skip on LoadState::Failed","Keep the cached patch loaded (strong handle or prevent free_unused_assets from evicting it) for as long as the ResolvedScene lives","Verify the asset path printed in the error exists and loads (inspect server.load_failed / failed ids)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if !patches.contains(&cached_handle) {\n    // not loaded (or unloaded): wait or bail with a clear message\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match resolved.spawn(&mut world) {\n    Err(SpawnSceneError::ApplySceneError(ApplySceneError::MissingCachedScene { id, path })) => {\n        warn!(\"cached scene {path:?} ({id:?}) missing — re-load before retrying\");\n    }\n    _ => {}\n}","preventionTips":["Keep strong handles to cached ScenePatches for the lifetime of scenes that include them","Watch the AssetServer failed-loads channel to catch failed loads early"],"tags":["bevy","scene","asset","caching","missing-asset"],"backgroundTag":"asset-not-found","analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}