{"record":{"id":"aeb31434e613b37b","repo":"bevyengine/bevy","slug":"error-adding-plugin-plugin-name-plugin-was-al","errorCode":null,"errorMessage":"Error adding plugin {plugin_name}: : plugin was already added in application","messagePattern":"Error adding plugin (.+?): : plugin was already added in application","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_app/src/plugin.rs","lineNumber":150,"sourceCode":"    use variadics_please::all_tuples;\n\n    use crate::{App, AppError, Plugin, PluginGroup};\n\n    pub trait Plugins<Marker> {\n        fn add_to_app(self, app: &mut App);\n    }\n\n    pub struct PluginMarker;\n    pub struct PluginGroupMarker;\n    pub struct PluginsTupleMarker;\n\n    impl<P: Plugin> Plugins<PluginMarker> for P {\n        #[track_caller]\n        fn add_to_app(self, app: &mut App) {\n            if let Err(AppError::DuplicatePlugin { plugin_name }) =\n                app.add_boxed_plugin(Box::new(self))\n            {\n                panic!(\n                    \"Error adding plugin {plugin_name}: : plugin was already added in application\"\n                )\n            }\n        }\n    }\n\n    impl<P: PluginGroup> Plugins<PluginGroupMarker> for P {\n        #[track_caller]\n        fn add_to_app(self, app: &mut App) {\n            self.build().finish(app);\n        }\n    }\n\n    macro_rules! impl_plugins_tuples {\n        ($(#[$meta:meta])* $(($param: ident, $plugins: ident)),*) => {\n            $(#[$meta])*\n            impl<$($param, $plugins),*> Plugins<(PluginsTupleMarker, $($param,)*)> for ($($plugins,)*)\n            where","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_app/src/plugin.rs#L132-L168","documentation":"Panics in the Plugins::add_to_app implementation for a single Plugin when App::add_boxed_plugin returns AppError::DuplicatePlugin: the exact plugin type has already been added to this App before. Bevy refuses to add the same plugin type twice to keep build logic idempotent.","triggerScenarios":"Thrown at crates/bevy_app/src/plugin.rs:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicate app.add_plugin(...) / app.add_plugins(...) call for the same plugin type","Check whether the plugin is already included via a PluginGroup (e.g. DefaultPlugins) before adding it manually","If conditional, guard the addition with a check of the plugin registry or use feature gates to avoid double registration"],"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-14T00:17:10.932Z"}