bevyengine/bevy · error

Plugin does not exist in group: {}.

Error message

Plugin does not exist in group: {}.

What it means

Panics in PluginGroupBuilder::add_before when try_add_before_overwrite fails because the target plugin type Target is not present in the builder. The method can only reorder plugins that already exist in the group; the new plugin has no anchor to be placed before.

Source

Thrown at crates/bevy_app/src/plugin_group.rs:440

            );

            self.order.push(plugin_id);
        }

        self
    }

    /// Adds a [`Plugin`] in this [`PluginGroupBuilder`] before the plugin of type `Target`.
    ///
    /// If the plugin was already the group, it is removed from its previous place.
    ///
    /// # Panics
    ///
    /// Panics if `Target` is not already in this [`PluginGroupBuilder`].
    pub fn add_before<Target: Plugin>(self, plugin: impl Plugin) -> Self {
        self.try_add_before_overwrite::<Target, _>(plugin)
            .unwrap_or_else(|_| {
                panic!(
                    "Plugin does not exist in group: {}.",
                    core::any::type_name::<Target>()
                )
            })
    }

    /// Adds a [`Plugin`] in this [`PluginGroupBuilder`] before the plugin of type `Target`.
    ///
    /// If the plugin was already in the group the add fails. If there isn't a plugin
    /// of type `Target` in the group the plugin we're trying to insert is returned.
    pub fn try_add_before<Target: Plugin, Insert: Plugin>(
        self,
        plugin: Insert,
    ) -> Result<Self, (Self, Insert)> {
        if self.contains::<Insert>() {
            return Err((self, plugin));
        }

View on GitHub (pinned to 396ca72708)

Solutions

  1. Ensure the Target plugin type is in the group before calling add_before (add it or keep it from the default group)
  2. Use plain add() if you do not need ordering relative to a target plugin
  3. Verify the Target generic parameter names the plugin you intended
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/bevy_app/src/plugin_group.rs:440 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/7cced3da0c45428c. Report an issue: GitHub.