swc-project/swc · warning

Plugin is not supported with current @swc/core. Plugin trans

Error message

Plugin is not supported with current @swc/core. Plugin transform will be skipped.

What it means

Emitted by the swc Rust crate when it was built without the `plugin` cargo feature but the supplied config contains jsc.experimental.plugins. SWC warns and uses a noop pass, so plugin transforms are skipped instead of failing the build.

Source

Thrown at crates/swc/src/config/mod.rs:869

            // Native runtime plugin target, based on assumption we have
            // 1. no filesystem access, loading binary / cache management should be
            // performed externally
            // 2. native runtime compiles & execute wasm (i.e v8 on node, chrome)
            #[cfg(all(feature = "plugin", target_arch = "wasm32"))]
            {
                handler.warn(
                    "Currently @swc/wasm does not support plugins, plugin transform will be \
                     skipped. Refer https://github.com/swc-project/swc/issues/3934 for the details.",
                );

                Box::new(noop_pass())
            }
        };

        #[cfg(not(feature = "plugin"))]
        let plugin_transforms: Box<dyn Pass> = {
            if experimental.plugins.is_some() {
                handler.warn(
                    "Plugin is not supported with current @swc/core. Plugin transform will be \
                     skipped.",
                );
            }
            Box::new(noop_pass())
        };

        let mut plugin_transforms = Some(plugin_transforms);

        let pass: Box<dyn Pass> = if experimental
            .disable_builtin_transforms_for_internal_testing
            .into_bool()
        {
            plugin_transforms.unwrap()
        } else {
            let jsx_enabled = syntax.jsx() && !jsx_preserve;

            let decorator_pass: Box<dyn Pass> =

View on GitHub (pinned to 5176682b65)

Solutions

  1. Enable the feature: swc = { version = "...", features = ["plugin"] } (and matching swc_core plugin features) so plugins actually execute.
  2. If you cannot enable it, remove plugins from the config to silence the warning and avoid shipping untransformed code.
  3. Fail fast: assert at startup that plugins are supported when the config requests them.

Example fix

# before
swc = { version = "14", default-features = false }

# after
swc = { version = "14", default-features = false, features = ["plugin"] }
Defensive patterns

Strategy: validation

Validate before calling

// At startup, fail fast if plugins are requested but not compiled in.
fn check_plugin_feature(requested: bool) -> anyhow::Result<()> {
    if requested && !cfg!(feature = "plugin") {
        anyhow::bail!("this binary was built without the swc 'plugin' feature; rebuild with features = [\"plugin\"] or remove plugins from config");
    }
    Ok(())
}

Type guard

fn pluginsCompiledIn() -> bool {
    cfg!(feature = "plugin")
}

Prevention

When it happens

Trigger: Depending on the swc crate with default-features=false (or a downstream binary that did not enable `plugin`) while passing Options whose experimental.plugins is Some; typically in custom Rust integrations or embedded compilers.

Common situations: Custom build pipelines that trim cargo features for compile time; distributions of swc built without the wasmtime-based plugin runtime; users surprised that plugins have no effect.

Related errors


AI-assisted analysis of swc-project/swc@5176682b65 (2026-08-17). Data as JSON: /api/errors/57e8410e1b5ed148. Report an issue: GitHub.