{"record":{"id":"f00f63e6c03d4728","repo":"bevyengine/bevy","slug":"rendertarget-textureview-missing-texture-view","errorCode":null,"errorMessage":"RenderTarget::TextureView missing ({texture_view:?}): make sure the texture view handle was not removed.","messagePattern":"RenderTarget::TextureView missing \\((.+?)\\): make sure the texture view handle was not removed\\.","errorType":"exception","errorClass":"MissingRenderTargetInfoError","httpStatus":null,"severity":"error","filePath":"crates/bevy_render/src/camera.rs","lineNumber":336,"sourceCode":"        match self {\n            NormalizedRenderTarget::Window(window_ref) => {\n                changed_window_ids.contains(&window_ref.entity())\n            }\n            NormalizedRenderTarget::Image(image_target) => {\n                changed_image_handles.contains(&image_target.handle.id())\n            }\n            NormalizedRenderTarget::TextureView(_) | NormalizedRenderTarget::None { .. } => true,\n        }\n    }\n}\n\n#[derive(Debug, thiserror::Error)]\npub enum MissingRenderTargetInfoError {\n    #[error(\"RenderTarget::Window missing ({window:?}): Make sure the provided entity has a Window component.\")]\n    Window { window: Entity },\n    #[error(\"RenderTarget::Image missing ({image:?}): Make sure the Image's usages include RenderAssetUsages::MAIN_WORLD.\")]\n    Image { image: AssetId<Image> },\n    #[error(\"RenderTarget::TextureView missing ({texture_view:?}): make sure the texture view handle was not removed.\")]\n    TextureView {\n        texture_view: ManualTextureViewHandle,\n    },\n}\n\n/// System in charge of updating a [`Camera`] when its window or projection changes.\n///\n/// The system detects window creation, resize, and scale factor change events to update the camera\n/// [`Projection`] if needed.\n///\n/// ## World Resources\n///\n/// [`Res<Assets<Image>>`](Assets<Image>) -- For cameras that render to an image, this resource is used to\n/// inspect information about the render target. This system will not access any other image assets.\n///\n/// [`OrthographicProjection`]: bevy_camera::OrthographicProjection\n/// [`PerspectiveProjection`]: bevy_camera::PerspectiveProjection\npub fn camera_system(","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_render/src/camera.rs#L318-L354","documentation":"The `TextureView` variant of `MissingRenderTargetInfoError` is returned by `Camera::target_info` when the camera targets `RenderTarget::TextureView(ManualTextureViewHandle)` but the `ManualTextureViews` resource no longer contains that handle: the manual texture view was removed or never inserted.","triggerScenarios":"Reading camera target info while the handle used in `RenderTarget::TextureView` has been removed from `ManualTextureViews` (e.g. an external surface like a video decoder output was torn down) or the handle id never matched an inserted view.","commonSituations":"Removing manual texture views during shutdown or hot-reload of external surfaces without retargeting cameras; handle mismatch after re-creating manual views with different ids.","solutions":["Keep the `ManualTextureView` inserted in `ManualTextureViews` for as long as any camera targets its handle","Before removing a manual view, repoint or despawn cameras referencing that handle","Double-check the handle you pass equals the one used at insertion"],"exampleFix":"// before\nmanual_texture_views.remove(&handle); // a camera still targets RenderTarget::TextureView(handle)\n\n// after\n// first retarget/despawn cameras using `handle`, then:\nmanual_texture_views.remove(&handle);","handlingStrategy":"try-catch","validationCode":"if manual_texture_views.contains_key(&handle) {\n    camera.target = RenderTarget::TextureView(handle);\n} else {\n    warn!(\"manual texture view {handle:?} not inserted; not targeting it\");\n}","typeGuard":"fn texture_view_target_ready(\n    handle: ManualTextureViewHandle,\n    views: &ManualTextureViews,\n) -> bool {\n    views.contains(&handle)\n}","tryCatchPattern":"match camera.target_info(windows, images, manual_texture_views) {\n    Err(MissingRenderTargetInfoError::TextureView { texture_view }) => {\n        warn!(\"manual texture view {texture_view:?} removed; skipping camera update\");\n    }\n    other => { /* proceed */ }\n}","preventionTips":["Remove manual texture views only after retargeting cameras away from them","Reuse stable ManualTextureViewHandle values across re-creations","Check ManualTextureViews membership before assigning the target"],"tags":["bevy","camera","render-target","manual-texture-view","handle"],"backgroundTag":"resource-handle-removed","analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}