bevyengine/bevy · error · WaitForAssetError

tried to wait for an asset that is not being loaded

Error message

tried to wait for an asset that is not being loaded

What it means

WaitForAssetError::NotLoaded — the caller tried to await an asset handle that is not actually being loaded (e.g. the handle was never enqueued for loading or already finished and was reclaimed). Only wait on handles produced by load-style requests that are still pending.

Source

Thrown at crates/bevy_asset/src/server/mod.rs:2367

}

impl core::fmt::Debug for AssetServer {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        f.debug_struct("AssetServer")
            .field("info", &self.data.infos.read())
            .finish()
    }
}

/// This is appended to asset sources when loading a [`LoadedUntypedAsset`]. This provides a unique
/// source for a given [`AssetPath`].
const UNTYPED_SOURCE_SUFFIX: &str = "--untyped";

/// An error when attempting to wait asynchronously for an [`Asset`] to load.
#[derive(Error, Debug, Clone)]
pub enum WaitForAssetError {
    /// The asset is not being loaded; waiting for it is meaningless.
    #[error("tried to wait for an asset that is not being loaded")]
    NotLoaded,
    /// The asset failed to load.
    #[error(transparent)]
    Failed(Arc<AssetLoadError>),
    /// A dependency of the asset failed to load.
    #[error(transparent)]
    DependencyFailed(Arc<AssetLoadError>),
}

#[derive(Error, Debug)]
pub enum WriteDefaultMetaError {
    #[error(transparent)]
    MissingAssetLoader(#[from] MissingAssetLoaderForExtensionError),
    #[error(transparent)]
    MissingAssetSource(#[from] MissingAssetSourceError),
    #[error(transparent)]
    MissingAssetWriter(#[from] MissingAssetWriterError),
    #[error("failed to write default asset meta file: {0}")]

View on GitHub (pinned to 227d3a6c66)

Solutions

  1. Start loading the asset (e.g. via AssetServer::load) before waiting
  2. Check that the handle came from an actual load request
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/bevy_asset/src/server/mod.rs:2352 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@227d3a6c66 (2026-08-20). Data as JSON: /api/errors/c74d61b6d5103f59. Report an issue: GitHub.