Typescript ts(2339): Property ‘xxx’ does not exist on type ‘PrismaClient’.™

I’m creating a nextjs@14 project with prismadb and react. I’ve defined the category model in schema.prisma file as seen like this:

model Category {
  // ...values
  // ...values
}

when trying to access the value of the model with ‘findMany’

const categories = await prismadb.category.findMany({
        where: {
            // ...values
            // ...values
        }
    })

i get this error for the category word:

Property ‘category’ does not exist on type ‘PrismaClient<PrismaClientOptions, never, DefaultArgs>’.ts(2339)

tried the following recommendations:

  1. npx prisma generate
  2. npx prisma db push
  3. restart vscode
  4. reload vscode window

any idea on how to fix this?

Leave a Comment