You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, I am using Prisma (with Lucia adapter) and Next.js 14.
So, when I try to call the following function in middleware.ts, it returns the error: Error: PrismaClient is unable to run in Vercel Edge Functions or Edge Middleware. As an alternative, try Accelerate: https://pris.ly/d/accelerate. (screenshot provided below).
I think this is because you shouldn't use the PrismaClient in middleware, rather to use PrismaClient from @prisma/client/edge. Check this issue for more details: prisma/prisma#21310
Package
lucia
Describe the bug
Hello,
First of all, I am using Prisma (with Lucia adapter) and Next.js 14.
So, when I try to call the following function in
middleware.ts
, it returns the error: Error: PrismaClient is unable to run in Vercel Edge Functions or Edge Middleware. As an alternative, try Accelerate: https://pris.ly/d/accelerate. (screenshot provided below).I think this is because you shouldn't use the PrismaClient in middleware, rather to use PrismaClient from @prisma/client/edge. Check this issue for more details: prisma/prisma#21310
The text was updated successfully, but these errors were encountered: