Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diagnose and fix Lingui SWC plugin compatibility errors with Next.js, Rspack, or other SWC runtimes. Use when seeing errors like "failed to invoke plugin", "failed to run Wasm plugin transform", "out of bounds memory access", or "LayoutError" during builds with @lingui/swc-plugin.
.claude/skills/platformplatform-swc-plugin-compatibility/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 1% | 0% |
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
RuntimeError: out of bounds memory access
LayoutError called Result::unwrap()This is NOT a bug. You're using an incompatible version of @lingui/swc-plugin with your SWC runtime.
SWC plugin support is experimental. The plugin API does not follow semantic versioning.
SWC uses Rkyv to transfer the AST between the core and plugins. Both must agree on the exact memory layout of the AST. If the layout changes (e.g., new ECMAScript features), older plugins cannot read the data correctly.
This layout cannot be negotiated at runtime - it must match at compile time.
Go to the compatibility table and find the plugin version that matches your runtime.
For precise matching, use https://plugins.swc.rs/:
next)next@15.0.1)@lingui/swc-plugin versionjson{ "devDependencies": { "@lingui/swc-plugin": "5.10.0" } }
Use an exact version (no ^ or ~) to prevent accidental upgrades.
| Plugin Version | @lingui/core | Notes | |----------------|--------------|-------| | 5.* | @lingui/core@5.* | Current | | 4.* | @lingui/core@4.* | Legacy |
Important: @lingui/swc-plugin does not need to match other @lingui/* package versions exactly. It follows its own versioning scheme.
@lingui/swc-plugin - check release notes firstswc-core in minor/patch releasesBy "runtime" we mean the tool executing SWC: Next.js, Rspack, or @swc/core.
Some runtimes (like Next.js) embed SWC directly and don't use @swc/core from npm. This means:
swc-core version via package.jsonjs// next.config.js /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { swcPlugins: [ ['@lingui/swc-plugin', { // Plugin options }], ], }, }; module.exports = nextConfig;
json{ "$schema": "https://json.schemastore.org/swcrc", "jsc": { "experimental": { "plugins": [ ["@lingui/swc-plugin", {}] ] } } }
If your runtime uses a newer swc-core that no plugin version supports yet:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 17,540 | 14,591 | -17% | 1 | 1 | 0% | 3,147 | 3,654 | +16% | 0 | 0 | — |
case-03 | fail→pass | 13,041 | 6,132 | -53% | 1 | 1 | 0% | 2,350 | 2,148 | -9% | 0 | 0 | — |
case-01 | fail→pass | 15,723 | 11,926 | -24% | 1 | 1 | 0% | 2,817 | 3,136 | +11% | 0 | 0 | — |
case-04 | pass→pass | 19,659 | 16,491 | -16% | 1 | 1 | 0% | 2,868 | 3,497 | +22% | 0 | 0 | — |
case-05 | fail→pass | 8,077 | 6,803 | -16% | 1 | 1 | 0% | 1,468 | 2,029 | +38% | 0 | 0 | — |
case-06 | pass→pass | 11,648 | 7,714 | -34% | 1 | 1 | 0% | 2,019 | 2,357 | +17% | 0 | 0 | — |
case-07 | pass→pass | 8,440 | 4,579 | -46% | 1 | 1 | 0% | 1,533 | 1,740 | +14% | 0 | 0 | — |
case-08 | pass→pass | 5,825 | 2,548 | -56% | 1 | 1 | 0% | 955 | 1,333 | +40% | 0 | 0 | — |
case-09 | pass→pass | 7,675 | 3,027 | -61% | 1 | 1 | 0% | 1,258 | 1,409 | +12% | 0 | 0 | — |
case-10 | pass→pass | 11,832 | 5,032 | -57% | 1 | 1 | 0% | 1,901 | 1,852 | -3% | 0 | 0 | — |
case-11 | pass→pass | 12,563 | 4,393 | -65% | 1 | 1 | 0% | 2,070 | 1,643 | -21% | 0 | 0 | — |
case-12 | pass→pass | 10,815 | 3,593 | -67% | 1 | 1 | 0% | 1,866 | 1,608 | -14% | 0 | 0 | — |
case-13 | fail→pass | 14,322 | 8,251 | -42% | 1 | 1 | 0% | 2,509 | 2,526 | +1% | 0 | 0 | — |
case-14 | fail→pass | 14,333 | 6,474 | -55% | 1 | 1 | 0% | 2,260 | 2,013 | -11% | 0 | 0 | — |
case-15 | pass→pass | 15,653 | 12,606 | -19% | 1 | 1 | 0% | 2,472 | 3,104 | +26% | 0 | 0 | — |
case-16 | fail→pass | 11,850 | 4,677 | -61% | 1 | 1 | 0% | 1,927 | 1,647 | -15% | 0 | 0 | — |
case-17 | pass→pass | 5,844 | 3,335 | -43% | 1 | 1 | 0% | 1,137 | 1,460 | +28% | 0 | 0 | — |
case-18 | fail→pass | 14,936 | 4,462 | -70% | 1 | 1 | 0% | 2,151 | 1,700 | -21% | 0 | 0 | — |
case-19 | pass→pass | 8,147 | 3,441 | -58% | 1 | 1 | 0% | 1,345 | 1,513 | +12% | 0 | 0 | — |
case-20 | pass→pass | 13,321 | 3,895 | -71% | 1 | 1 | 0% | 1,988 | 1,569 | -21% | 0 | 0 | — |
case-21 | pass→pass | 10,865 | 7,829 | -28% | 1 | 1 | 0% | 2,038 | 2,314 | +14% | 0 | 0 | — |
case-22 | pass→pass | 12,644 | 12,183 | -4% | 1 | 1 | 0% | 2,227 | 3,240 | +45% | 0 | 0 | — |
case-23 | pass→pass | 13,103 | 7,703 | -41% | 1 | 1 | 0% | 2,424 | 2,425 | +0% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +35 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.