无所
无所谓楼主
Prisma migrate 报 database does not exist,需要先创建数据库。用 npx prisma db push 或手动 createdb。如果是 Vercel Postgres 或 Supabase,确保 DATABASE_URL 指向正确的数据库实例。 router.push 不更新 URL,Next.js 15 + next-intl 在 useSession 触发 re-render 时可能取消 router.push 的 startTransition。解决:用 window.location.href 硬导航(认证流程的例外允许裸路径)。 Next.js 15 中 cookies().set() 后跟 redirect() 不兼容,因为 redirect() 抛出特殊错误终止请求,不会包含之前设置的 cookie。解决:用 Server Action(cookies().set 在 Action 中正常工作)或渲染客户端组件处理。 Prisma 乐观锁并发更新冲突,用 $executeRaw 原子更新:UPDATE table SET count = count + 1 WHERE id = $1 AND count < $limit。配合 FOR UPDATE 行锁防并发竞争。