swc-plugin-compatibility
Skill439 starsChanged 6 months agoMITView on GitHub
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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- lingui/skillstheir own version, first seen Sep 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- lingui/skills★ 10same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- aspire-restartSkill
- aspire-stopSkill
- buildSkill
- commitSkill
- create-prdSkill
- create-pull-requestSkill
- db-querySkill
- e2eSkill
- enhanced-message-contextSkill
- fix-e2e-testsSkill
- formatSkill
- lingui-best-practicesSkill
- lintSkill
- pull-platformplatform-changesSkill
- rebrandSkill
- rebuild-branchSkill
- team-interruptSkill
- testSkill
- ultra-reviewSkill
- upgrade-packagesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
If you see errors like these during your build:
- Very specific: line 51
Use an exact version (no ^ or ~) to prevent accidental upgrades.
- Very specific: line 65
Don't auto-bump
@lingui/swc-plugin: - check release notes first - Very specific: line 113
If your runtime uses a newer swc-core that no plugin version supports yet:
- Distinctive: line 115
Check for recent plugin releases
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
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.
Why This Happens
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.
How to Fix
Step 1: Check the Compatibility Table
Go to the compatibility table and find the plugin version that matches your runtime.
Step 2: Use the Plugin Compatibility Site
For precise matching, use https://plugins.swc.rs/:
- Select your runtime (e.g.,
next) - Select your runtime version (e.g.,
next@15.0.1) - Find a compatible
@lingui/swc-pluginversion
Step 3: Pin Your Versions
{
"devDependencies": {
"@lingui/swc-plugin": "5.10.0"
}
}Use an exact version (no ^ or ~) to prevent accidental upgrades.
Version Compatibility Quick Reference
| 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.
Rules to Avoid Build Breakage
- Pin an exact plugin version compatible with your runtime
- Don't auto-bump
@lingui/swc-plugin- check release notes first - Don't auto-bump your runtime (Next.js, Rspack, etc.) - runtimes may bump
swc-corein minor/patch releases - Check compatibility after any upgrade that touches SWC or the plugin
Understanding Runtimes
By "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:
- You cannot control
swc-coreversion viapackage.json - Plugin compatibility depends on the runtime's embedded SWC version
Example: Next.js Configuration
// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
swcPlugins: [
['@lingui/swc-plugin', {
// Plugin options
}],
],
},
};
module.exports = nextConfig;Example: .swcrc Configuration
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"experimental": {
"plugins": [
["@lingui/swc-plugin", {}]
]
}
}
}What If No Compatible Version Exists?
If your runtime uses a newer swc-core that no plugin version supports yet:
- Check for recent plugin releases
- Open an issue or PR at https://github.com/lingui/swc-plugin
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

