{"record":{"id":"60fb228f91df8995","repo":"bevyengine/bevy","slug":"subapp-update-was-called-while-a-plugin-was-bui","errorCode":null,"errorMessage":"SubApp::update() was called while a plugin was building.","messagePattern":"SubApp::update\\(\\) was called while a plugin was building\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_app/src/sub_app.rs","lineNumber":147,"sourceCode":"        core::mem::swap(self, &mut app.sub_apps.main);\n    }\n\n    /// Returns a reference to the [`World`].\n    pub fn world(&self) -> &World {\n        &self.world\n    }\n\n    /// Returns a mutable reference to the [`World`].\n    pub fn world_mut(&mut self) -> &mut World {\n        &mut self.world\n    }\n\n    /// Runs the default schedule.\n    ///\n    /// Does not clear internal trackers used for change detection.\n    pub fn run_default_schedule(&mut self) {\n        if self.is_building_plugins() {\n            panic!(\"SubApp::update() was called while a plugin was building.\");\n        }\n\n        if let Some(label) = self.update_schedule {\n            self.world.run_schedule(label);\n        }\n    }\n\n    /// Runs the default schedule and updates internal component trackers.\n    pub fn update(&mut self) {\n        self.run_default_schedule();\n        self.world.clear_trackers();\n    }\n\n    /// Extracts data from `world` into the app's world using the registered extract method.\n    ///\n    /// **Note:** There is no default extract method. Calling `extract` does nothing if\n    /// [`set_extract`](Self::set_extract) has not been called.\n    pub fn extract(&mut self, world: &mut World) {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_app/src/sub_app.rs#L129-L165","documentation":"Panics in SubApp::run_default_schedule (reached via SubApp::update) when the sub-app still has a plugin in the middle of building. Running the default schedule while plugin build code is executing would observe a half-initialized app, so the call is rejected until plugin building completes.","triggerScenarios":"Thrown at crates/bevy_app/src/sub_app.rs:147 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not call App::update()/SubApp::update() from within a plugin's build method or while app.building_plugin is active","Move the update call to after app initialization finishes (e.g. after App::new() ... and the runner takes over)","If driving updates manually, ensure they happen outside of any plugin build closure"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}