Agent skill

Swc Plugin Compatibility

by B0und in B0und/WikiSpeedrun

Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Vite, Rspack, or other SWC runtimes.

MITAuto-check passedFrontend & Design

Install Swc Plugin Compatibility

skills CLI
$ npx skills add B0und/WikiSpeedrun --skill swc-plugin-compatibility -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install B0und/WikiSpeedrun swc-plugin-compatibility --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/B0und/WikiSpeedrun.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/swc-plugin-compatibility .claude/skills/swc-plugin-compatibility && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
swc-plugin-compatibility
GitHub stars
133
Token cost
~2.3k tokens
SKILL.md length
989 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Vite, Rspack, or other SWC runtimes.

  • Works in 3 steps: Identify the host and its resolved version → Choose the plugin version → Pin exactly and confirm
  • Seeing errors like failed to invoke plugin
  • SKILL.md covers Why This Happens, How to Fix, Keeping It Working and Example: Next.js Configuration, plus 4 more sections
  • Calls npm; reaches plugins.swc.rs and json.schemastore.org

What it does

Swc Plugin Compatibility is an agent skill from B0und/WikiSpeedrun. Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Vite, Rspack, or other SWC runtimes. Use when seeing errors like "failed to invoke plugin", "failed to run Wasm plugin transform", "Failed to deserialize program received from host", "Failed to execute SWC plugin", "out of bounds memory access", or "LayoutError" during builds with @lingui/swc-plugin — or when macros are silently not transformed (build succeeds but Trans/t render as raw untranslated output).

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design. It works with Next.js, Vite, WebAssembly and npm. The repository describes itself as: Wikipedia Speedrun Game. The licence is MIT.

When your agent uses it

  • Seeing errors like failed to invoke plugin
  • Failed to run Wasm plugin transform
  • Failed to deserialize program received from host
  • Failed to execute SWC plugin

Example prompts

  • “failed to invoke plugin”
  • “failed to run Wasm plugin transform”
  • “Failed to deserialize program received from host”
  • “/swc-plugin-compatibility”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Identify the host and its resolved version
  2. Choose the plugin version
  3. Pin exactly and confirm

What it can do on your machine

Read from SKILL.md and the folder at commit a03d655. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • plugins.swc.rs
    • json.schemastore.org

    Also links to:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Swc Plugin Compatibility loads about 2.3k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 989 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~126
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from B0und/WikiSpeedrun at commit a03d655, republished under its MIT licence (© B0und). 989 words, ~2,298 tokens.

Download SKILL.mdSave it as .claude/skills/swc-plugin-compatibility/SKILL.md (or your agent's skills folder).
name
swc-plugin-compatibility
description
Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Vite, Rspack, or other SWC runtimes. Use when seeing errors like "failed to invoke plugin", "failed to run Wasm plugin transform", "Failed to deserialize program received from host", "Failed to execute SWC plugin", "out of bounds memory access", or "LayoutError" during builds with @lingui/swc-plugin — or when macros are silently not transformed (build succeeds but Trans/t render as raw untranslated output).

SWC Plugin Compatibility

If you see errors like these during your build:

failed to invoke plugin on 'Some("/app/src/file.ts")'
failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime.
    swc_plugin_runner: <n>
: Failed to deserialize program received from host
Failed to execute SWC plugin                      (Next.js / Turbopack wording of the same failure)
RuntimeError: out of bounds memory access         (older hosts)
LayoutError called Result::unwrap()               (older hosts)

This is NOT a bug in your code or in Lingui. The installed @lingui/swc-plugin was built against an swc_core version your SWC host cannot run.

Why This Happens

Every @lingui/swc-plugin release is compiled against one pinned swc_core version — the plugin's compatibility table lists them. The host (Next.js's bundled SWC, or the @swc/core that @vitejs/plugin-react-swc / Rspack resolves) accepts plugins from a range of swc_core versions. Outside that range the Wasm plugin cannot deserialize the AST it is handed, and the build fails on every file that uses a macro.

SWC has stabilised the plugin ABI over time, so mismatches are rarer than they were, but hosts still move past plugins and plugins past hosts (see lingui/swc-plugin #250 and #253 for one of each). The pairing is something to check, never assume.

How to Fix

Step 1: Identify the host and its resolved version
Signal in the projectHostRead the version from
next in dependencies, no .babelrcNext.js's bundled SWCnpm ls next
@vitejs/plugin-react-swc@swc/corenpm ls @swc/core — the lockfile resolution, not the caret range the plugin declares
Rspack / @swc/core directly@swc/corenpm ls @swc/core

Next.js embeds SWC and ignores any @swc/core in package.json; only the Next.js version decides its swc_core. On Vite, two projects with identical package.json can resolve different @swc/core versions — the lockfile is the source of truth.

Step 2: Choose the plugin version
  1. Read the host's accepted swc_core range. The error message usually prints a https://plugins.swc.rs/versions/from-plugin-runner/<n> URL — open it in a browser; for Next.js, select runtime next and the resolved version on https://plugins.swc.rs. The site is client-rendered, so a plain fetch returns an empty page; the fallback is the host's own pin: for Next.js, swc_core in the root Cargo.toml of the vercel/next.js tag (v<version>), for @swc/core, its GitHub release notes.
  2. In the plugin's compatibility table, take the newest @lingui/swc-plugin whose swc_core falls inside that range.
  3. Check its peer: npm view @lingui/swc-plugin@<version> peerDependencies. Each plugin major requires the matching @lingui/core major as a required peer (a newer plugin major may also admit the previous core major). A candidate whose peer excludes the installed @lingui/core is not a candidate — the install fails with ERESOLVE instead of the build failing. Pick the next-newest that passes, or go to "What If No Compatible Version Exists?".

The compatibility site has lagged behind releases before. When the table and the site disagree, or the host is newer than either lists, decide by building: try the newest plugin, then step back one swc_core row at a time until a macro-using file compiles.

Hosts drift independently, so two hosts in one repo (a Next.js app and a Vite app) can legitimately need two different plugin versions.

Step 3: Pin exactly and confirm
json
{
  "devDependencies": {
    "@lingui/swc-plugin": "<exact version>"
  }
}

Use an exact version (no ^ or ~) so a routine dependency bump cannot move it. Done when the build passes on a file that uses a macro and the rendered output shows translated text rather than raw macro source.

Keeping It Working

  1. Pin the plugin exactly and exclude it from Renovate/Dependabot auto-merge; bump it deliberately, after checking the compatibility table.
  2. Treat host upgrades as plugin upgrades. Hosts change swc_core in minor and patch releases, so a Next.js or @vitejs/plugin-react-swc bump needs the same check — put both packages in one update group.
  3. Build after any upgrade that touches SWC or the plugin. The build, not the changelog, is the confirmation.

@lingui/swc-plugin does not track the other @lingui/* versions; it releases on its own cadence, so its version number carries no information about which @lingui/core it pairs with beyond the peer field.

Show full SKILL.md (386 more words)Show less

Example: Next.js Configuration

js
// next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    swcPlugins: [
      ['@lingui/swc-plugin', {
        // Plugin options
      }],
    ],
  },
};

export default nextConfig;

Example: .swcrc Configuration

json
{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "experimental": {
      "plugins": [
        ["@lingui/swc-plugin", {}]
      ]
    }
  }
}

Example: Vite Configuration

ts
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { lingui } from "@lingui/vite-plugin";

export default defineConfig({
  plugins: [
    react({ plugins: [["@lingui/swc-plugin", {}]] }),
    lingui(),
  ],
});

Silent Failure: Wrong Plugin Entry Shape

Every SWC plugin entry must be a [name, options] tuple, even with empty options. Passing the plugin name as a bare string silently disables the macro transform: the build succeeds, but <Trans> never resolves and messages render as raw macro output.

ts
// ❌ Silently does nothing
react({ plugins: ["@lingui/swc-plugin"] })

// ✅ Tuple with options object
react({ plugins: [["@lingui/swc-plugin", {}]] })

The same applies to Next.js swcPlugins and .swcrc plugins arrays.

What If No Compatible Version Exists?

When no plugin version that installs beside the project's @lingui/core fits the host, make an explicit choice rather than guessing:

  1. Move the host to a version whose swc_core range has a matching plugin (usually forward: newer hosts accept newer plugins)
  2. Switch to the Babel transform (@lingui/babel-plugin-lingui-macro) — see the caveats below
  3. Open an issue or PR at https://github.com/lingui/swc-plugin

Forcing the install (--legacy-peer-deps) or downgrading @lingui/core to satisfy an old plugin's peer are not on this list: the first hides the mismatch until the build, the second regresses the runtime to please a build tool.

Babel Fallback on Next.js
bash
npm install -D @lingui/babel-plugin-lingui-macro babel-plugin-macros @babel/types
json
// .babelrc
{ "presets": ["next/babel"], "plugins": ["macros"] }

Remove the experimental.swcPlugins entry. Three things the Babel path needs that the SWC plugin did not:

  1. @babel/types installed explicitly. Next bundles its own Babel and does not expose it to plugins; without it the build fails with Cannot find package '@babel/types'.
  2. A lingui.config.ts (or .js/.mjs). The Babel macro reads it at compile time; the SWC plugin never did, so a project that got by without one breaks here.
  3. Acceptance that .babelrc turns off Next's SWC compiler for the whole project — Next prints Disabled SWC as replacement for Babel because of custom Babel configuration, and compiler options in next.config are ignored from then on. Builds get slower; prefer moving the host when that is an option.
Babel Fallback Caveat: @vitejs/plugin-react 6

@vitejs/plugin-react@6 dropped its internal Babel and removed the babel option entirely. On v6+, the classic form:

ts
react({ babel: { plugins: ["@lingui/babel-plugin-lingui-macro"] } })

no longer works — a TypeScript config fails with TS2353 ("babel does not exist in type..."); a plain JS config is silently ignored and macros never get transformed.

Your options on Vite:

  • Stay on SWC: @vitejs/plugin-react-swc + an exactly pinned @lingui/swc-plugin chosen by the steps above (preferred)
  • Run the macro as a standalone Babel pass (@rolldown/plugin-babel on Vite 8, vite-plugin-babel on Vite ≤ 7) — the lingui-framework-setup skill has the wiring
  • Pin @vitejs/plugin-react@^5, which still supports the babel option

© B0und, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/swc-plugin-compatibility of B0und/WikiSpeedrun.

Open the folder on GitHubat commit a03d655

Compare with similar skills

Swc Plugin Compatibility next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Swc Plugin Compatibility compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Swc Plugin Compatibility this skillB0und/WikiSpeedrun133—~2.3kAutomated safety check: PassMIT
Convex Quickstartspokvulcan/poker-planning1146 repos~3.5kAutomated safety check: NotesMIT
Spotpatchhuanglvjing/spotpatch134—~998Automated safety check: PassMIT
Convex Self Hostingwaynesutton/markdown-site628—~1.4kAutomated safety check: PassMIT
Chakra UI v3 Builderchakra-ui/chakra-ui41k—~3.1kAutomated safety check: PassMIT
GSAP for Reactgreensock/gsap-skills16k4 repos~1.6kAutomated safety check: PassMIT

Similar skills

  • Convex Quickstart

    spokvulcan/poker-planning

    Creates or adds Convex to an app. An agent skill from spokvulcan/poker-planning.

    114 GitHub starsUsed in 6 repos~3.5k tokens
    Frontend & DesignAuto-check: notes
  • Spotpatch

    huanglvjing/spotpatch

    为 React 项目建立从浏览器页面元素到精确 JSX/TSX 源码、结构化上下文与可审阅修改的 SpotPatch 工作流。用户提到 SpotPatch、截图沟通前端修改、页面元素定位源码、Vite 或 Next.js 接入、组件数据链路、结构化 Prompt、AI 补丁审阅、安装检查或故障排查时使用此技能。

    134 GitHub stars~998 tokensUpdated 9 days ago
    Frontend & DesignAuto-check passed
  • Convex Self Hosting

    waynesutton/markdown-site

    Integrate Convex static self hosting into existing apps using the latest upstream instructions from get-convex/self-hosting every time.

    628 GitHub stars~1.4k tokensUpdated 4 mo ago
    DevOps & CloudAuto-check passed
  • Chakra UI v3 Builder

    chakra-ui/chakra-ui

    Builds responsive, accessible Chakra UI v3 components and layouts, sets up Chakra in new or existing projects, and designs themes with tokens, semantic tokens and recipes.

    41k GitHub stars~3.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • GSAP for React

    greensock/gsap-skills

    Shows how to run GSAP animations in React and Next.js with the useGSAP hook, refs, scoped selectors and automatic cleanup on unmount.

    16k GitHub starsUsed in 4 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • Creative Tim UI Blocks

    creativetimofficial/ui

    Helps install, generate and review Creative Tim UI blocks: shadcn/ui-based React and Tailwind sections that follow a restrained, production-minded design philosophy.

    12k GitHub stars~2.1k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check: notes

More from B0und/WikiSpeedrun

  • Lingui Best Practices

    B0und/WikiSpeedrun

    Implement internationalization with Lingui in React and JavaScript applications.

    133 GitHub starsUsed in 2 repos~4.2k tokens
    Auto-check passed
  • Find Unwrapped Strings

    B0und/WikiSpeedrun

    Audit a Lingui project for hardcoded user-facing strings that were never wrapped in macros.

    133 GitHub stars~2.1k tokensUpdated 17 days ago
    Auto-check passed
  • Lingui Framework Setup

    B0und/WikiSpeedrun

    Set up Lingui in a React framework. An agent skill from B0und/WikiSpeedrun.

    133 GitHub stars~1.9k tokensUpdated 17 days ago
    Auto-check passed
  • Migrate I18next To Lingui

    B0und/WikiSpeedrun

    Migrate i18next/react-i18next projects to Lingui. An agent skill from B0und/WikiSpeedrun.

    133 GitHub stars~3.1k tokensUpdated 17 days ago
    Auto-check passed
  • Enhanced Message Context

    B0und/WikiSpeedrun

    Add translator comments to Lingui messages so translations are accurate.

    133 GitHub stars~3.3k tokensUpdated 17 days ago
    Auto-check passed

Questions about Swc Plugin Compatibility

What does Swc Plugin Compatibility do?

Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Vite, Rspack, or other SWC runtimes. Swc Plugin Compatibility is an agent skill from B0und/WikiSpeedrun.js, Vite, Rspack, or other SWC runtimes.

When should I use Swc Plugin Compatibility?

Swc Plugin Compatibility fits situations like: seeing errors like failed to invoke plugin; failed to run Wasm plugin transform; failed to deserialize program received from host; failed to execute SWC plugin.

How do I install Swc Plugin Compatibility in Claude Code?

Run `npx skills add B0und/WikiSpeedrun --skill swc-plugin-compatibility -a claude-code`. Or copy the skill folder (.agents/skills/swc-plugin-compatibility in B0und/WikiSpeedrun) into .claude/skills/swc-plugin-compatibility in your project. Claude Code loads it when a task matches its description.

How do I install Swc Plugin Compatibility in Codex?

Run `npx skills add B0und/WikiSpeedrun --skill swc-plugin-compatibility -a codex`. Or copy the skill folder (.agents/skills/swc-plugin-compatibility in B0und/WikiSpeedrun) into .agents/skills/swc-plugin-compatibility in your project. Codex loads it when a task matches its description.

Can I use Swc Plugin Compatibility in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add B0und/WikiSpeedrun --skill swc-plugin-compatibility -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/swc-plugin-compatibility, .gemini/skills/swc-plugin-compatibility, .github/skills/swc-plugin-compatibility and .opencode/skills/swc-plugin-compatibility in your project.

What does Swc Plugin Compatibility need to run?

Going by SKILL.md and its folder, Swc Plugin Compatibility needs the command-line tools its instructions call (npm). Our summary lists: Node.js.

Does Swc Plugin Compatibility access the network?

SKILL.md names 3 domains. In commands or code: plugins.swc.rs and json.schemastore.org; the agent is likely to contact these when it follows the instructions. As links in the text: github.com. This is read from the text; nothing was executed.

Is Swc Plugin Compatibility safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Swc Plugin Compatibility use?

Swc Plugin Compatibility is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Swc Plugin Compatibility use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Swc Plugin Compatibility?

Skills that share tags, products or a category with Swc Plugin Compatibility: Convex Quickstart (spokvulcan/poker-planning, 114 stars), Spotpatch (huanglvjing/spotpatch, 134 stars), Convex Self Hosting (waynesutton/markdown-site, 628 stars) and Chakra UI v3 Builder (chakra-ui/chakra-ui, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Swc Plugin Compatibility?

B0und (a GitHub user) maintains it in B0und/WikiSpeedrun, which has 133 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on September 19, 2026.

Source: B0und/WikiSpeedrun on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.