{"record":{"id":"9384a3c1e6a7108a","repo":"swc-project/swc","slug":"not-supported-yet","errorCode":null,"errorMessage":"Not supported yet","messagePattern":"Not supported yet","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_plugin_proxy/src/metadata/transform_plugin_metadata.rs","lineNumber":106,"sourceCode":"            let (key_ptr, key_ptr_len) = serialized.as_ptr();\n            __copy_context_key_to_host_env(key_ptr as u32, key_ptr_len as u32);\n\n            __get_experimental_transform_context(serialized_ptr)\n        });\n\n        #[cfg(not(target_arch = \"wasm32\"))]\n        None\n    }\n\n    /// Returns experimental metadata context, but returns whole value as a\n    /// HashMap.\n    ///\n    /// Each time this is called, it'll require a call between host-plugin which\n    /// involves serialization / deserialization.\n    #[allow(unreachable_code)]\n    pub fn get_raw_experimental_context(&self) -> swc_common::plugin::metadata::Context {\n        // TODO: There is no clear usecase yet - enable when we have a correct usecase.\n        unimplemented!(\"Not supported yet\");\n\n        #[cfg(target_arch = \"wasm32\")]\n        return read_returned_result_from_host(|serialized_ptr| unsafe {\n            __get_raw_experiemtal_transform_context(serialized_ptr)\n        })\n        .expect(\"Raw experimental metadata should exists, even if it's empty map\");\n\n        #[cfg(not(target_arch = \"wasm32\"))]\n        swc_common::plugin::metadata::Context(rustc_hash::FxHashMap::default())\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":118,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_plugin_proxy/src/metadata/transform_plugin_metadata.rs#L88-L118","documentation":"TransformPluginProgramMetadata::get_raw_experimental_context in swc_plugin_proxy is deliberately unimplemented: a TODO comment states there is no clear use case yet, and the unimplemented!(\"Not supported yet\") sits before both the wasm32 host-call return and the native fallback, so the function panics on every target. Unlike its siblings (get_transform_plugin_config, get_context, get_experimental_context) which return real values on wasm32 and None on native, this bulk-HashMap accessor has no working path at all.","triggerScenarios":"Calling metadata.get_raw_experimental_context() anywhere — inside a plugin transform (wasm32 guest) or in host-side code/tests that construct TransformPluginProgramMetadata.","commonSituations":"Plugin authors assuming the 'raw' variant of the experimental-context API mirrors get_experimental_context; copying swc_core internal call sites; upgrading swc_core versions where experimental metadata APIs shifted.","solutions":["Use get_experimental_context(key) per key instead — it is implemented and returns Option<String> on wasm32.","If you need several keys, enumerate the known keys and call get_experimental_context for each.","Upstream an implementation in crates/swc_plugin_proxy/src/metadata/transform_plugin_metadata.rs (the host import __get_raw_experiemtal_transform_context already exists) if the bulk API is required."],"exampleFix":"// before: always panics — TODO'd out upstream\nlet all: Context = metadata.get_raw_experimental_context();\n\n// after: use the implemented per-key API\nfor key in [\"cacheKey\", \"envs\", \"globals\"] {\n    if let Some(v) = metadata.get_experimental_context(key) {\n        handle(key, v);\n    }\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Rust: the API panics (not a Result); if you must isolate it, contain and fall back\nlet raw = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\n    metadata.get_raw_experimental_context()\n}));\nlet value = raw.ok().or_else(|| metadata.get_experimental_context(key));","preventionTips":["Prefer get_experimental_context(key) / get_context(kind) — both are implemented on wasm32","Grep the vendored swc_plugin_proxy source for unimplemented! before relying on metadata APIs","Pin swc crate versions and review changelogs when touching experimental metadata APIs"],"tags":["wasm-plugin","plugin-metadata","unimplemented","experimental-api","swc-plugin-proxy"],"backgroundTag":"unimplemented-api-stub","analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}