I have the app working directly fine on my local dev env but when deploying to Vercel I got this type error which was not expected.
I'm using Nextjs, Prisma, tRPC.
any hints on what I might be missing?
There is two solutions:
@unique
field (like id
) to find your unique student:const student = await prisma.student.findUnique({ where: { id: input.id } })
input.code
and grab the first one:const [student] = await prisma.student.findMany({ where: { code: input.code } })