{"record":{"id":"7523a714f7784847","repo":"swc-project/swc","slug":"transform-plugin-cannot-be-used-without-serializat","errorCode":null,"errorMessage":"Transform plugin cannot be used without serialization support","messagePattern":"Transform plugin cannot be used without serialization support","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_plugin_runner/src/lib.rs","lineNumber":54,"sourceCode":"        unresolved_mark,\n        metadata_context,\n        plugin_env_vars,\n        plugin_config,\n        plugin_runtime,\n    )\n}\n\n#[cfg(not(feature = \"encoding-impl\"))]\npub fn create_plugin_transform_executor(\n    source_map: &Arc<SourceMap>,\n    unresolved_mark: &swc_common::Mark,\n    metadata_context: &Arc<TransformPluginMetadataContext>,\n    plugin_env_vars: Option<Arc<Vec<swc_atoms::Atom>>>,\n    plugin_module: Box<dyn PluginModuleBytes>,\n    plugin_config: Option<serde_json::Value>,\n    runtime: Option<()>,\n) -> TransformExecutor {\n    unimplemented!(\"Transform plugin cannot be used without serialization support\")\n}\n","sourceCodeStart":36,"sourceCodeEnd":56,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_plugin_runner/src/lib.rs#L36-L56","documentation":"swc_plugin_runner::create_plugin_transform_executor builds the executor that loads a .wasm transform plugin and exchanges serialized ASTs with it. The entire pipeline depends on the serialization protocol enabled by the encoding-impl feature (which turns on swc_common/plugin-rt and swc_plugin_proxy/plugin-rt). Without it, the constructor is compiled as a signature-compatible stub that panics with unimplemented!(\"Transform plugin cannot be used without serialization support\") rather than returning an executor that could never talk to the plugin.","triggerScenarios":"Calling create_plugin_transform_executor in a build of swc_plugin_runner where encoding-impl is not enabled — e.g. default-features = false without re-adding it, or a dependency graph that pulls swc_plugin_runner for host utilities while dropping the plugin runtime features.","commonSituations":"Embedding swc's plugin runner into a custom host with trimmed features; feature unification across workspace members disabling optional serialization; version drift after feature rewiring between swc releases.","solutions":["Enable the feature: swc_plugin_runner = { features = [\"encoding-impl\"] } (or let the normal swc/plugin host dependency chain enable it).","Confirm resolution with `cargo tree -e features -i swc_plugin_runner` and check for encoding-impl / plugin-rt edges.","If plugin execution was not intended in this build, remove the call path that constructs the transform executor."],"exampleFix":"# before: executor construction panics\n[dependencies]\nswc_plugin_runner = { version = \"34\", default-features = false }\n\n# after\n[dependencies]\nswc_plugin_runner = { version = \"34\", default-features = false, features = [\"encoding-impl\"] }","handlingStrategy":"validation","validationCode":"cargo tree -e features -i swc_plugin_runner | grep -E 'encoding-impl|plugin-rt' \\\n  || echo 'swc_plugin_runner lacks serialization features — create_plugin_transform_executor will panic'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable swc_plugin_runner/encoding-impl whenever plugin execution is in scope","Re-check the feature graph after trimming default features or bumping swc versions","Add a CI build that constructs a plugin executor once to catch feature regressions"],"tags":["feature-flag","wasm-plugin","plugin-runner","serialization","build-config"],"backgroundTag":"missing-feature-flag","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"}