swc-plugin-compatibility
Installation
SKILL.md
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.