1

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?

Code

Vercel deploy log

sumato
  • 15
  • 2

1 Answers1

0

There is two solutions:

  1. Use a prisma @unique field (like id) to find your unique student:
const student = await prisma.student.findUnique({ where: { id: input.id } })
  1. Try to find every students with that input.code and grab the first one:
const [student] = await prisma.student.findMany({ where: { code: input.code } })
devpolo
  • 2,487
  • 3
  • 12
  • 28