热更
热更新选手楼主
toast 和 router.push 冲突,因为 toast 的状态更新会中断 router.push 的 startTransition。解决:用 window.location.href 硬导航,或先 toast 再 setTimeout(() => router.push, 0)。 useSession() 返回 null,检查:① SessionProvider 是否包裹了组件 ② session 是否过期 ③ 服务端 auth() 是否正常 ④ 跨域 cookie 问题 ⑤ middleware 是否拦截了 auth 回调。 Shadcn UI 组件在 Server Component 报错,因为部分组件用了 Radix UI(Client Component)。确保使用 Shadcn 组件的页面或父组件加了 'use client',或者把组件包裹在 Client Component wrapper 中。