Given this schema: https://github.com/tonijarjour/website/blob/main/prisma/schema.prisma
model Like {
id Int @id @default(autoincrement())
addr String
route String
@@unique([route, addr])
}
Code where it happens: https://github.com/tonijarjour/website/blob/main/pages/api/sendlike/[route].ts:
const prevLike = await prisma.like.findUnique({
where: {
route_addr: {
route: route as string,
addr: clientIp as string,
},
},
});
Error:
Type error: Type '{ route_addr: { route: string; addr: string; }; }' is not assignable to type 'LikeWhereUniqueInput'.
Object literal may only specify known properties, and 'route_addr' does not exist in type 'LikeWhereUniqueInput'.
This error happens on Vercel. It builds fine on my system.