PrismaClient unsafe any
I keep getting this error. Linter blocks build. So i did create t3 app without prisma then decided to add it later on. ive done theo's tutorial before and never had this issue. and yes ive googled it before and prismaclient unsafe any leads to no related results. Im pretty sure im missing something really obvious but i cant seem to see it.
Solution:Jump to solution
I keep getting this error. Linter blocks build. So i did create t3 app without prisma then decided to add it later on. ive done theo's tutorial before and never had this issue. and yes ive googled it before and prismaclient unsafe any leads to no related results. Im pretty sure im missing something really obvious but i cant seem to see it.
37 Replies
@Josh
Aight there has to be more context cause your not importing globalThis
Give me the full file
thats the full file lol
and theo's tutorial one is like this
Where are you defining globalThis
i have no idea i tried to copy theo's tutorial again
let me do a grep
so im not definining it anywhere it seems
but that line isnt throwing an erroro
Try this
global
is an actual keyword, globalThis is notok i tried
same issue
Lemme see w/ error
What's the big error
so my theory is that somehow prismaclient constructor returns an any type?
It shouldn't, what I sent is code from my repo that works fine
yeah so im very confused now lol bc this is a very weird issue
which version of prisma client are you using?
I hate to ask but you have a Prisma file and it's installed and etc etc
4.14.1
yes i do, i did prisma init and all
ok same version too
Oh wait send you package json
fyi i downgraded from 4.14
bc i wanted to see if that fixed the error
Ahhh
Install
prisma
As dev dep
Then restart your vs codecrap i think what i did was i installed it as a dep
no a dev dep
im an idiot
No no your missing a package
Prisma client is where it should be
wait
no
You also need
prisma
See Prisma 4th up from the bottom
yup i just did that
prisma as dev dep
prisma client as dep
still same error
Did you restart va
Vs
would it be bad if i just ignored this error?
yes
Yes
Is the repo open source
its not sadly
but i just started so that db.ts file is lterally just that
Hmm
which is why im extremely confused regarding this error
prismaclient constructor shouldnt return an any
all the other errors are related to that
basically that line is unsafe construction of any type value
then the other lines are unsafe assignment of any
so if i can solve the constructor issue it should all be resolved
Very weird
I still don't see anything wrong
fuck i know what i did wrong
i didnt run prisma generate again
oh my god im an idiot
sorry for wasting your time lol
That was it?
Hahahaha
i have no idea why i didnt work the first time when i set everything up tho
oh well
at least i got it to work