冬炉
冬炉暖茶楼主
router.push 不更新 URL,Next.js 15 + next-intl 在 useSession 触发 re-render 时可能取消 router.push 的 startTransition。解决:用 window.location.href 硬导航(认证流程的例外允许裸路径)。 Prisma 事务中 create 返回的 id 在 commit 前可能不可用。如果需要用 id 生成 slug,可以在事务内先 create 再 update slug,或用 cuid() 手动生成 id。注意 Prisma @default(cuid()) 在 create 时生成。 Google OAuth 回调报 OAuthCallback 错误,检查:① GOOGLE_CLIENT_ID/SECRET 是否正确 ② NEXTAUTH_URL 是否与 Google Console 中的回调 URL 一致 ③ redirect URI 是否匹配 ④ 时钟同步问题。 Vercel Edge Runtime 不支持 Prisma,因为 Prisma 依赖 Node.js 原生模块。Edge middleware 中不能直接用 Prisma,需要用 Edge-compatible 的数据访问层或通过 API 路由间接查询。