bevyengine/bevy · error

Requested non-send resource {} does not exist in the `World`

Error message

Requested non-send resource {} does not exist in the `World`.\n                Did you forget to add it using `app.insert_non_send` / `app.init_non_send`?\n                Non-send resources can also be added by plugins.

What it means

Error "Requested non-send resource {} does not exist in the `World`.\n Did you forget to add it using `app.insert_non_send` / `app.init_non_send`?\n Non-send resources can also be added by plugins." thrown in bevyengine/bevy.

Source

Thrown at crates/bevy_ecs/src/world/mod.rs:2385

    pub fn resource_entity<R: Resource>(&self) -> Option<Entity> {
        let component_id = self.component_id::<R>()?;
        self.resource_entities().get(component_id)
    }

    /// Gets an immutable reference to the non-send data of the given type, if it exists.
    ///
    /// # Panics
    ///
    /// Panics if the data does not exist.
    /// Use [`get_non_send`](World::get_non_send) instead if you want to handle this case.
    ///
    /// This function will panic if it isn't called from the same thread that the resource was inserted from.
    #[inline]
    #[track_caller]
    pub fn non_send<R: 'static>(&self) -> &R {
        match self.get_non_send() {
            Some(x) => x,
            None => panic!(
                "Requested non-send resource {} does not exist in the `World`.
                Did you forget to add it using `app.insert_non_send` / `app.init_non_send`?
                Non-send resources can also be added by plugins.",
                DebugName::type_name::<R>()
            ),
        }
    }

    /// Gets a mutable reference to the non-send data of the given type, if it exists.
    ///
    /// # Panics
    ///
    /// Panics if the data does not exist.
    /// Use [`get_non_send_mut`](World::get_non_send_mut) instead if you want to handle this case.
    ///
    /// This function will panic if it isn't called from the same thread that the resource was inserted from.
    #[inline]
    #[track_caller]

View on GitHub (pinned to 396ca72708)

Solutions

  1. Add the data with app.insert_non_send(...) / app.init_non_send::<R>()
  2. Use world.get_non_send::<R>() to handle absence gracefully
  3. Only touch non-send data from the main thread
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/bevy_ecs/src/world/mod.rs:2385 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/bc089a653a23dcb0. Report an issue: GitHub.