Commit 857d9c1
committed
fix(build): Server Component 里不能用 next/dynamic({ssr:false})
Vercel preview 挂在这句:
const DocShareButton = dynamic(..., { ssr: false });
Next.js 15+ 明确禁止 Server Component 里使用 next/dynamic 的 ssr:false 选项
(本地 turbopack dev 宽容不报,production build 必 fail)。
之前引入它是为了避开疑似 fumadocs PageTOCPopover 的 hydration mismatch,
但 DocShareButton 本身已是 'use client' 组件,useState 不会影响 sibling 的
useId 计数;实际 local + vercel build 都不再复现该 mismatch,直接走标准
'use client' 导入即可。
pnpm build 本地通过。1 parent 91f0079 commit 857d9c1
1 file changed
Lines changed: 1 addition & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 17 | + | |
31 | 18 | | |
32 | 19 | | |
33 | 20 | | |
| |||
0 commit comments