{"record":{"id":"10dc2dd029ce2f33","repo":"swc-project/swc","slug":"currently-swc-wasm-does-not-support-plugins-plug","errorCode":null,"errorMessage":"Currently @swc/wasm does not support plugins, plugin transform will be skipped. Refer https://github.com/swc-project/swc/issues/3934 for the details.","messagePattern":"Currently @swc/wasm does not support plugins, plugin transform will be skipped\\. Refer https://github\\.com/swc-project/swc/issues/3934 for the details\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/swc/src/config/mod.rs","lineNumber":857,"sourceCode":"\n                Box::new(crate::plugin::plugins(\n                    experimental.plugins,\n                    experimental.plugin_env_vars,\n                    transform_metadata_context,\n                    comments.cloned(),\n                    cm.clone(),\n                    unresolved_mark,\n                    plugin_runtime,\n                ))\n            }\n\n            // Native runtime plugin target, based on assumption we have\n            // 1. no filesystem access, loading binary / cache management should be\n            // performed externally\n            // 2. native runtime compiles & execute wasm (i.e v8 on node, chrome)\n            #[cfg(all(feature = \"plugin\", target_arch = \"wasm32\"))]\n            {\n                handler.warn(\n                    \"Currently @swc/wasm does not support plugins, plugin transform will be \\\n                     skipped. Refer https://github.com/swc-project/swc/issues/3934 for the details.\",\n                );\n\n                Box::new(noop_pass())\n            }\n        };\n\n        #[cfg(not(feature = \"plugin\"))]\n        let plugin_transforms: Box<dyn Pass> = {\n            if experimental.plugins.is_some() {\n                handler.warn(\n                    \"Plugin is not supported with current @swc/core. Plugin transform will be \\\n                     skipped.\",\n                );\n            }\n            Box::new(noop_pass())\n        };","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc/src/config/mod.rs#L839-L875","documentation":"Emitted by the swc crate when it is compiled for the wasm32 target (i.e. @swc/wasm) with the plugin feature enabled: wasm-in-wasm plugin execution is not supported in that build, so SWC warns and substitutes a noop pass. Any configured jsc.experimental.plugins are silently skipped and the transform runs without them.","triggerScenarios":"Running @swc/wasm (browser/wasm environments, or as the automatic fallback when native bindings fail to install) with jsc.experimental.plugins or plugin_paths configured in the swc config.","commonSituations":"Native @swc/core install failed so the JS layer fell back to @swc/wasm while the config still lists wasm plugins; CI/browser environments using @swc/wasm directly; users confused why plugin transforms have no effect.","solutions":["Fix the native @swc/core installation (reinstall with optional platform deps) so plugins actually run.","Remove plugins from the config when you must stay on @swc/wasm, and replace their behavior with config-driven transforms.","Fail fast yourself: detect the wasm binding before transform and throw instead of silently shipping untransformed output.","Track swc-project/swc#3934 for wasm-target plugin support."],"exampleFix":"// .swcrc before (plugins silently ignored under @swc/wasm)\n{\n  \"jsc\": {\n    \"experimental\": { \"plugins\": [[\"./my_plugin.wasm\", {}]] }\n  }\n}\n\n// after (when running on wasm, express the transform with supported config)\n{\n  \"jsc\": {\n    \"experimental\": { \"plugins\": [] },\n    \"transform\": { \"optimizer\": { \"globals\": { \"vars\": { \"__DEBUG__\": \"false\" } } } }\n  }\n}","handlingStrategy":"validation","validationCode":"// In Rust builds targeting wasm32, reject plugin configs loudly instead of\n// accepting a silent noop pass.\n#[cfg(target_arch = \"wasm32\")]\nfn reject_plugins(experimental: &Option<ExperimentalOptions>) -> anyhow::Result<()> {\n    if let Some(e) = experimental {\n        if e.plugins.is_some() {\n            anyhow::bail!(\"plugins are not supported on wasm32 builds; remove jsc.experimental.plugins\");\n        }\n    }\n    Ok(())\n}","typeGuard":"fn pluginRuntimeSupported(): boolean {\n  // The warning only fires on wasm32 builds of the swc crate, i.e. @swc/wasm.\n  // Treat 'native binding absent' as 'plugins unsupported'.\n  const os = require('os') as typeof import('os');\n  const { optionalDependencies } = require('@swc/core/package.json');\n  const tri = `@swc/core-${os.platform()}-${os.arch()}`;\n  return Object.keys(optionalDependencies ?? {}).some(\n    (d) => d.startsWith(tri) && (() => { try { require.resolve(d); return true; } catch { return false; } })()\n  );\n}","tryCatchPattern":null,"preventionTips":["Check which binding (@swc/core native vs @swc/wasm) resolves before enabling plugins.","Add output snapshots in tests so silently skipped plugins fail the build.","Subscribe to swc-project/swc#3934 for wasm-target plugin support status."],"tags":["wasm","plugin","not-supported","config","swc-wasm"],"backgroundTag":"wasm-plugin-unsupported","analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}