Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Property 'create' does not exist" in prisma client

Tags:

node.js

prisma

I have an entity defined "Board" in prisma.schema like this:

model Board {
  id        String   @id @default(uuid())
  createdAt DateTime @default(now()) @ignore
  updatedAt DateTime @updatedAt @ignore
  title     String
  posts     Post[]
  Team      Team     @relation(fields: [teamId], references: [id])
  teamId    String
}

After using prisma for a while, now the prisma.board.create function is unavailable (I think it was at around the time I added updatedAt)

I do have access to the rest of the functions, but trying to use create gives no autocomplete and this error:

Property 'create' does not exist on type 'BoardDelegate'.ts(2339)

What am I doing wrong? What are the usual cases for create not existing when the rest of the methods are there?

like image 945
kylar13 Avatar asked Sep 06 '25 21:09

kylar13


1 Answers

I added "?" sign to these field and it worked:

model Board {
...
  createdAt DateTime? @default(now()) @ignore
  updatedAt DateTime? @updatedAt @ignore
...
}
like image 183
Moshe Yamini Avatar answered Sep 09 '25 13:09

Moshe Yamini