{"record":{"id":"35824eeaa9521790","repo":"swc-project/swc","slug":"unexpected-error-occurred-while-running-plugin-tra","errorCode":null,"errorMessage":"Unexpected error occurred while running plugin transform","messagePattern":"Unexpected error occurred while running plugin transform","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_plugin_runner/src/transform_executor.rs","lineNumber":97,"sourceCode":"        let transformed_result = Arc::try_unwrap(self.transform_result)\n            .map_err(|_| {\n                anyhow!(\"Failed to unwrap Arc: other references to transform_result exist\")\n            })?\n            .into_inner();\n        let ret = PluginSerializedBytes::from_bytes(transformed_result);\n\n        let ret = if returned_ptr_result == 0 {\n            Ok(ret)\n        } else {\n            let err: PluginError = ret.deserialize()?.into_inner();\n            match err {\n                PluginError::SizeInteropFailure(msg) => Err(anyhow!(\n                    \"Failed to convert pointer size to calculate: {msg}\"\n                )),\n                PluginError::Deserialize(msg) | PluginError::Serialize(msg) => {\n                    Err(anyhow!(\"{msg}\"))\n                }\n                _ => Err(anyhow!(\n                    \"Unexpected error occurred while running plugin transform\"\n                )),\n            }\n        };\n\n        ret\n    }\n\n    /**\n     * Check compile-time version of AST schema between the plugin and\n     * the host. Returns true if it's compatible, false otherwise.\n     *\n     * Host should appropriately handle if plugin is not compatible to the\n     * current runtime.\n     */\n    #[allow(unreachable_code)]\n    pub fn is_transform_schema_compatible(&mut self) -> Result<(), Error> {\n        #[cfg(any(","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_plugin_runner/src/transform_executor.rs#L79-L115","documentation":"The plugin returned bytes that deserialize into a PluginError variant the runner does not specifically match (anything other than SizeInteropFailure), so it reports a generic transform failure. The plugin failed in an unexpected way and the runner has no finer classification for it.","triggerScenarios":"Thrown at crates/swc_plugin_runner/src/transform_executor.rs:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the plugin standalone or with plugin logs to find the root cause","Disable the plugin to unblock the build and file a bug against it","Extend the PluginError match in the runner to surface the new variant's details"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}