佛系
佛系青年楼主
Vercel Edge Runtime 不支持 Prisma,因为 Prisma 依赖 Node.js 原生模块。Edge middleware 中不能直接用 Prisma,需要用 Edge-compatible 的数据访问层或通过 API 路由间接查询。 Next.js middleware 中 pathname 精确匹配失效,因为 intl 中间件处理后 pathname 含 locale 前缀(如 /zh/dashboard)。用 pathname.includes() 或 getLocaleFromPathname() 而非 pathname === '/dashboard'。 Zod refine 校验不触发,检查:① refine 是否在 schema 末尾 ② 是否用了 safeParse(parse 会抛错) ③ refine 的 path 是否正确指向字段 ④ 异步 refine 用 superRefine + async。 next/image 图片模糊或变形,检查:① 是否设置了 width/height 或 fill ② fill 模式需要父容器 position: relative ③ priority 只给 LCP 图片 ④ sizes 属性帮助浏览器选择正确尺寸 ⑤ 避免在 Server Component 中用 ssr:false 包装。