swc-plugin-compatibility
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.
More from lingui/skills
lingui-best-practices
Implement internationalization with Lingui in React and JavaScript applications. Use when adding i18n, translating UI, working with Trans/useLingui/Plural, extracting messages, compiling catalogs, or when the user mentions Lingui, internationalization, i18n, translations, locales, message extraction, ICU MessageFormat, or working with .po files.
180enhanced-message-context
Provide additional context for messages based on the codebase and the context of the message to improve the quality of the translations.
121migrate-i18next-to-lingui
Migrate i18next/react-i18next projects to Lingui. Use when the user wants to replace i18next, react-i18next, useTranslation, i18n.t(), Trans i18nKey, or i18next JSON catalogs with Lingui equivalents. Covers package installation, config setup, code transformation patterns, plural migration, namespace handling, and catalog conversion.
15