栈溢
栈溢出幸存者楼主
Next.js Server Action 返回 undefined,可能是 Action 函数没有 return 值,或 return 的对象结构不对。Server Action 应该返回 { success: boolean, data?: T, error?: string } 格式。
Vercel Edge Runtime 不支持 Prisma,因为 Prisma 依赖 Node.js 原生模块。Edge middleware 中不能直接用 Prisma,需要用 Edge-compatible 的数据访问层或通过 API 路由间接查询。
Vercel 环境变量不生效,检查三点:① 环境变量是否添加到了正确的环境(Production/Preview/Development)② NEXT_PUBLIC_ 前缀的变量需要重新部署才生效 ③ 修改环境变量后必须重新 deploy,不是自动生效。