wasmerio/wasmer · error

Cannot build a StoreAsync within a sync context

Error message

Cannot build a StoreAsync within a sync context

What it means

Error "Cannot build a StoreAsync within a sync context" thrown in wasmerio/wasmer.

Source

Thrown at lib/api/src/backend/sys/entities/function/env.rs:316

            func_env: self.func_env.clone(),
        }
    }

    /// Borrows a new immmutable reference
    pub fn as_ref(&self) -> FunctionEnv<T> {
        self.func_env.clone()
    }

    /// Borrows a new mutable reference
    pub fn as_mut(&mut self) -> Self {
        self.clone()
    }

    /// Creates an [`AsStoreAsync`] from this [`AsyncFunctionEnvMut`].
    pub fn as_store_async(&self) -> impl AsStoreAsync + 'static {
        match &self.store {
            AsyncFunctionEnvMutStore::Sync(_) => {
                panic!("Cannot build a StoreAsync within a sync context")
            }
            AsyncFunctionEnvMutStore::Async(store) => StoreAsync {
                id: store.id,
                inner: store.inner.clone(),
            },
        }
    }
}

#[cfg(feature = "experimental-async")]
impl<T> Clone for AsyncFunctionEnvMut<T> {
    fn clone(&self) -> Self {
        Self {
            store: self.store.clone(),
            func_env: self.func_env.clone(),
        }
    }
}

View on GitHub (pinned to 8c4b9ee9d3)

When it happens

Trigger: Thrown at lib/api/src/backend/sys/entities/function/env.rs:316 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01). Data as JSON: /api/errors/7f3e1b448304af42. Report an issue: GitHub.