{"record":{"id":"7f3e1b448304af42","repo":"wasmerio/wasmer","slug":"cannot-build-a-storeasync-within-a-sync-context","errorCode":null,"errorMessage":"Cannot build a StoreAsync within a sync context","messagePattern":"Cannot build a StoreAsync within a sync context","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/api/src/backend/sys/entities/function/env.rs","lineNumber":316,"sourceCode":"            func_env: self.func_env.clone(),\n        }\n    }\n\n    /// Borrows a new immmutable reference\n    pub fn as_ref(&self) -> FunctionEnv<T> {\n        self.func_env.clone()\n    }\n\n    /// Borrows a new mutable reference\n    pub fn as_mut(&mut self) -> Self {\n        self.clone()\n    }\n\n    /// Creates an [`AsStoreAsync`] from this [`AsyncFunctionEnvMut`].\n    pub fn as_store_async(&self) -> impl AsStoreAsync + 'static {\n        match &self.store {\n            AsyncFunctionEnvMutStore::Sync(_) => {\n                panic!(\"Cannot build a StoreAsync within a sync context\")\n            }\n            AsyncFunctionEnvMutStore::Async(store) => StoreAsync {\n                id: store.id,\n                inner: store.inner.clone(),\n            },\n        }\n    }\n}\n\n#[cfg(feature = \"experimental-async\")]\nimpl<T> Clone for AsyncFunctionEnvMut<T> {\n    fn clone(&self) -> Self {\n        Self {\n            store: self.store.clone(),\n            func_env: self.func_env.clone(),\n        }\n    }\n}","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/api/src/backend/sys/entities/function/env.rs#L298-L334","documentation":"Error \"Cannot build a StoreAsync within a sync context\" thrown in wasmerio/wasmer.","triggerScenarios":"Thrown at lib/api/src/backend/sys/entities/function/env.rs:316 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}