Model type not match #24236
Model type not match
#24236
-
QuestionI have a model called artical, which type is generated by prisma client, // child component A
import { Artical } from "@prisma/client";
interface ArticalProps {
data: Artical | null
}
// parent component
const artical = await prisma.artical.findUnique({
where: {
id: params.id,
},
});
return <A data={artical}/> but I get the type error likes:
is not assignable to type Artical
How can I fix this issue without add as any, How to reproduce (optional)Expected behavior (optional)No response Information about Prisma Schema, Client Queries and Environment (optional)// Add your schema.prisma // Add any relevant Prisma Client queries here
|
Beta Was this translation helpful? Give feedback.
Answered by
kaiwenxiao
May 28, 2024
Replies: 1 comment 1 reply
-
Hi @kaiwenxiao 👋 Thank you for raising this question. Can you please provide a reproducible repository so that we can take a look at this issue? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ludralph
Thanks for your passion, I figure out it myself, just turn on the TS Language Services in my editor WebStorm, and the issue was fixed.