← ClaudeAtlas

swc-plugin-compatibilitylisted

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).
lingui/skills · ★ 9 · Web & Frontend · score 79
Install: claude install-skill lingui/skills
# 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](https://github.com/lingui/swc-plugin/blob/main/packages/lingui-macro/README.md#compatibility) 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](https://github.com/lingui/swc-plugin/issues/250) and [#253]