Pinja Jäkkö
11/17/2021, 12:13 PMTSError: ⨯ Unable to compile TypeScript:
src/controllers/charts/discussions.ts:61:26 - error TS2694: Namespace '"[...]/node_modules/.prisma/client/index".Prisma' has no exported member 'validator'.
61 const messages: Prisma.validator<Prisma.discussionInclude>()({
Hi, I'm trying to use the validator for the first time but am getting this error.Ryan
11/17/2021, 12:16 PMPrismaClient in a separate directory?Pinja Jäkkö
11/17/2021, 12:22 PM@prisma/client , or at least that's what npx prisma generate says.Pinja Jäkkö
11/17/2021, 12:22 PMimport { Prisma } from "@prisma/client"Pinja Jäkkö
11/17/2021, 12:23 PMnode_modules/.prisma/client, node_modules/@prisma/client and node_modules/prisma/prisma-clientRyan
11/17/2021, 12:38 PMPinja Jäkkö
11/17/2021, 12:53 PMRyan
11/17/2021, 1:03 PMPinja Jäkkö
11/17/2021, 1:07 PMPinja Jäkkö
11/17/2021, 1:07 PMPinja Jäkkö
11/17/2021, 1:08 PMRyan
11/17/2021, 1:34 PMnode_modules package-lock.json and installing again and it fixed the issue.Pinja Jäkkö
11/17/2021, 1:39 PMPinja Jäkkö
11/17/2021, 1:43 PMPinja Jäkkö
11/17/2021, 1:44 PMPinja Jäkkö
11/17/2021, 2:12 PMRyan
11/17/2021, 2:19 PMPinja Jäkkö
11/17/2021, 2:22 PMRyan
11/17/2021, 2:23 PMPrisma.validator as a type. That’s incorrect. You need to use it directly as a function as shown here.Pinja Jäkkö
11/17/2021, 2:26 PMmessages: Prisma.discussionInclude at first and I didn't realize I need to change the : to a = when I changed it 🤦♀️ thanks for helping!