-
SummaryI’m using Next.js 16 with the new React Compiler but I also use Lingui macros. Additional informationOperating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103
Available memory (MB): 8192
Available CPU cores: 8
Binaries:
Node: 22.20.0
npm: 10.9.3
Yarn: 4.4.0
pnpm: N/A
Relevant Packages:
next: 16.0.0
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: N/AExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The problem is that Next.js 16's To fix this, you must force Next.js to use a custom Babel configuration by removing the Create this .babelrc file in your project's root: // .babelrc
{
"presets": ["next/babel"],
"plugins": [
"@lingui/babel-plugin-lingui-macro", // Must be first
"babel-plugin-react-compiler" // Runs after Lingui
]
}This configuration respects Lingui's requirement and should solve the issue where macros are breaking. Also, you can check docs on how to setup babel. |
Beta Was this translation helpful? Give feedback.
@dieguezz Unfortunately, this doesn’t work because
babel-plugin-react-compilerprocesses server components, and Next runs with errors likeCannot read properties of undefined (reading 'H')on server components, which makes it impossible to work. A few hours of debugging led me to patchbabel-plugin-react-compiler, and now it works.