{"record":{"id":"7ad9e3ebe64858ab","repo":"bevyengine/bevy","slug":"failed-to-apply-the-cached-scene-asset-path-ca","errorCode":null,"errorMessage":"Failed to apply the cached Scene (asset path: \"{cached:?}\"): {error}","messagePattern":"Failed to apply the cached Scene \\(asset path: \"(.+?)\"\\): (.+?)","errorType":"exception","errorClass":"ApplySceneError","httpStatus":null,"severity":"error","filePath":"crates/bevy_scene/src/resolved_scene.rs","lineNumber":616,"sourceCode":"    },\n    /// Caused when attempting to include a cached scene when a [`ResolvedScene`] already has [`Template`]s or related scenes.\n    #[error(\"Attempted to include cached scene (id {id:?}, path: {path:?}), but the resolved scene already has templates. For correctness, the cached scene should always be included first.\")]\n    LateCached {\n        /// The asset id of the cached scene that was included late.\n        id: UntypedAssetId,\n        /// The path of the cached scene that was included late.\n        path: Option<AssetPath<'static>>,\n    },\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.","sourceCodeStart":598,"sourceCodeEnd":634,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_scene/src/resolved_scene.rs#L598-L634","documentation":"Variant of ApplySceneError. When a ResolvedScene that includes a cached scene is applied, the cached scene is applied first; if that inner application fails, the failure is wrapped as CachedSceneApplyError carrying the cached scene's asset path and a boxed inner ApplySceneError. The wrapper preserves where in the layering the failure happened.","triggerScenarios":"Spawning/applying a scene that has an included cached scene, where the cached scene itself fails to apply (its own templates or nested related scenes fail). The inner error is produced inside the cached apply path and boxed into this variant.","commonSituations":"A cached scene built against an older version of the components it contains; nested cached scenes where an inner entity reference no longer resolves; corrupted or stale ScenePatch assets after a schema change.","solutions":["Read the inner boxed ApplySceneError — the real cause is inside `error`, not this variant","Rebuild/re-cache the cached scene asset so it matches current component definitions","Reproduce by applying the cached ScenePatch directly to isolate the failing layer"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result {\n    Err(ApplySceneError::CachedSceneApplyError { cached, error }) => {\n        error!(\"cached scene {cached:?} failed: {error}\"); // recurse: error may itself be CachedSceneApplyError\n    }\n    _ => {}\n}","preventionTips":["Re-cache scene assets whenever component definitions change","Treat this variant as a location pointer — always debug the inner boxed error"],"tags":["bevy","scene","caching","nested-error","spawn"],"backgroundTag":"scene-apply-failed","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"}