bevyengine/bevy · error

Unable to get RenderApp. Another plugin may have removed the

Error message

Unable to get RenderApp. Another plugin may have removed the RenderApp before PipelinedRenderingPlugin

What it means

Panic in PipelinedRenderingPlugin::cleanup: the RenderApp sub-app is missing when setting up the render thread, meaning another plugin removed RenderApp before this plugin ran. Enable PipelinedRenderingPlugin after RenderPlugin and do not remove the RenderApp.

Source

Thrown at crates/bevy_render/src/pipelined_rendering.rs:137

        let mut sub_app = SubApp::new();
        sub_app.set_extract(renderer_extract);
        app.insert_sub_app(RenderExtractApp, sub_app);
    }

    // Sets up the render thread and inserts resources into the main app used for controlling the render thread.
    fn cleanup(&self, app: &mut App) {
        // skip setting up when headless
        if app.get_sub_app(RenderExtractApp).is_none() {
            return;
        }

        let (app_to_render_sender, app_to_render_receiver) = async_channel::bounded::<SubApp>(1);
        let (render_to_app_sender, render_to_app_receiver) = async_channel::bounded::<SubApp>(1);

        let mut render_app = app
            .remove_sub_app(RenderApp)
            .expect("Unable to get RenderApp. Another plugin may have removed the RenderApp before PipelinedRenderingPlugin");

        // clone main thread executor to render world
        let executor = app.world().get_resource::<MainThreadExecutor>().unwrap();
        render_app.world_mut().insert_resource(executor.clone());

        render_to_app_sender.send_blocking(render_app).unwrap();

        app.insert_resource(RenderAppChannels::new(
            app_to_render_sender,
            render_to_app_receiver,
        ));

        std::thread::Builder::new()
            .name("Render thread".into())
            .spawn(move || {
                #[cfg(feature = "trace")]
                let _span = bevy_log::info_span!("render thread").entered();

View on GitHub (pinned to 396ca72708)

Solutions

  1. Remove or reorder the plugin that deletes the RenderApp
  2. Ensure render-specific plugins are added to the RenderApp, not the main app
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/bevy_render/src/pipelined_rendering.rs:137 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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