Link to the code that reproduces this issue
https://github.com/katanabe/nextjs-mdx-multibyte-bug
To Reproduce
- Clone the reproduction repo
- Run
npm install
- Run
npm run build
The MDX file (app/test/page.mdx) contains Japanese text with full-width parentheses:
export const metadata = {
title: "Test",
};
# Test
これはテスト(サンプル)です。
The issue is triggered by multibyte characters in the MDX body (e.g., ()), not by export const metadata content.
Current vs. Expected behavior
Current behavior:
Build fails with SWC panic:
thread '<unnamed>' panicked at swc_common-18.0.0/src/source_map.rs:657:62:
byte index 88 is not a char boundary; it is inside '(' (bytes 87..90)
Expected behavior:
Build should succeed, as it does in Next.js 16.0.10.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin 25.1.0
Available memory (MB): 65536
Available CPU cores: 12
Binaries:
Node: 24.11.1
npm: 11.3.0
pnpm: 9.15.9
Relevant Packages:
next: 16.1.1
react: 19.0.0
react-dom: 19.0.0
Which area(s) are affected? (Select all that apply)
SWC (minification/transpilation), Turbopack
Which stage(s) are affected? (Select all that apply)
next build (default compiler)
Additional context
Version comparison:
| Version |
Result |
| 16.0.10 |
✅ Build succeeds |
| 16.1.0 |
❌ SWC panic |
| 16.1.1 |
❌ SWC panic |
Likely cause:
This regression was likely introduced by the SWC version bump in 16.1.0:
The issue occurs when Rust string slicing attempts to access a byte index that falls in the middle of a multibyte UTF-8 character (Japanese full-width parenthesis ( is 3 bytes).
Link to the code that reproduces this issue
https://github.com/katanabe/nextjs-mdx-multibyte-bug
To Reproduce
npm installnpm run buildThe MDX file (
app/test/page.mdx) contains Japanese text with full-width parentheses:The issue is triggered by multibyte characters in the MDX body (e.g.,
()), not byexport const metadatacontent.Current vs. Expected behavior
Current behavior:
Build fails with SWC panic:
Expected behavior:
Build should succeed, as it does in Next.js 16.0.10.
Provide environment information
Which area(s) are affected? (Select all that apply)
SWC (minification/transpilation), Turbopack
Which stage(s) are affected? (Select all that apply)
next build (default compiler)
Additional context
Version comparison:
Likely cause:
This regression was likely introduced by the SWC version bump in 16.1.0:
The issue occurs when Rust string slicing attempts to access a byte index that falls in the middle of a multibyte UTF-8 character (Japanese full-width parenthesis
(is 3 bytes).