What are the reasons for the client’s `create` me...
# prisma-client
r
What are the reasons for the client’s
create
method not existing?
r
@Ramon Pans 👋 Has this been solved?
r
No, it was not, I was unclear in the question but I was actually doing
prisma.board.create
and not
prisma.create
r
Try running
prisma generate
and check if the types are present. Seems like the types are not generated.
r
It’s not a type issue either, tried generate a couple times, and then just ran the code anyway with the error (Next doesn’t actually use tsc, and babel ignores the ts errors) and still wasn’t running
I got it solved by removing updatedAt @updatedAt from all models, but I see nothing in the docs that says it isn’t supported
r
Could you provide a reproduction repo?
@updatedAt
shouldn’t affect your types in any way.
r
I could look into setting up a repo, but I don’t think it was a type issue, just that all
create
and
upsert
methods where removed from all of my models’ functions. Like, actually removed, even without actually using typescript they just weren’t there and crashed at runtime
I saw in the docs that there are some cases where some unsupported data is found and therefore prisma removes “insertion” support, but I saw no evidence that @updatedAt would cause that
r
Depends on your schema. Are you using
@@ingored
or
@ingored
in any field or model?
If you are, then
create
will not be available.
r
No, just @ignore in both createdAt and updatedAt
r
Yes so you won’t be able to
create
with
@ignore
.
You need to remove
@ignore
.
r
That’s weird, because I kept
@ignore
in
createdAt
and it works, just the combination of both @updatedAt @ignore was not working for me
r
Seems like a bug then. I would suggest creating one here so that we can look into this. I can suggest you a workaround depending on your use case so you can remove
@ignore
as of now.
r
I just removed the
updatedAt
field, not needed for now, and kept
createdAt
with
@ignore
. Everything seems to work now, I’ll see later if I need to add
updatedAt
or not
👍 1