```TSError: ⨯ Unable to compile TypeScript: ...
# prisma-client
p
Copy code
TSError: ⨯ 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.
r
@Pinja Jäkkö 👋 Are you generating
PrismaClient
in a separate directory?
p
@Ryan are you referring to the node module directory? My client is in
@prisma/client
, or at least that's what
npx prisma generate
says.
I'm doing
import { Prisma } from "@prisma/client"
there's
node_modules/.prisma/client
,
node_modules/@prisma/client
and
node_modules/prisma/prisma-client
r
Ohh, in that case can you update Prisma to the latest version and check? If that doesn't work, then I would need a sample reproduction to check.
p
what exactly would you need for the reproduction?
r
Just a simple repo with the schema will do. I just need to check the TS error.
p
hopefully that works
I tried it with node 12, 14 and 16
could typescript version affect it? EDIT: I apparently have the newest stable typescript version so probably not
r
Tried removing
node_modules
package-lock.json
and installing again and it fixed the issue.
p
which node version are you using?
still not working for me 😞
I'll try to see if it works on Windows (currently running on WSL Ubuntu)
didn't work on windows at least with node 12
r
I’m on a Mac running Node 14
p
node 14 (on windows) didn't work either 🤔 should I just make a github issue...?
r
Ahh I see, you’re using
Prisma.validator
as a type. That’s incorrect. You need to use it directly as a function as shown here.
p
ohhhhh okay 😅 it was just
messages: Prisma.discussionInclude
at first and I didn't realize I need to change the
:
to a
=
when I changed it 🤦‍♀️ thanks for helping!
🙌 1