Prisma queries return type any
I have a basic T3 app with Prisma that I just created today. Basic queries are giving a return type of any and I cannot figure out what I'm missing. Any ideas here?
13 Replies
I have ran prisma generate and restarted VS code. Looking at the type def for findUnique shows this return type.
runtime.Types.Result
is any.Any help is greatly appreciated!
Even with a brand new T3 app I'm getting this error
What do the Prisma models look like?
@julius who's the main maintainer for CT3A?
Here's the default from T3
Hi, I get the same thing after creating a new project today. Curiously enough it seems like some queries work. I find that the Unique and Many queries both return 'any' values
Well look at that... using npm instead of pnpm worked
Man I despise these types of issues
I hope you can get it working as well 🙂
Nvm, it's still problematic when you actually use the query
I give up
This is probably related: https://github.com/t3-oss/create-t3-app/issues/1751
GitHub
bug: "Error: Unsafe assignment of an
any
value" when trying to ru...Provide environment information System: OS: Windows 10 10.0.19045 CPU: (6) x64 Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz Memory: 2.73 GB / 10.00 GB Binaries: Node: 21.1.0 - C:\Program Files\nodejs\n...
Thanks for looking into this. Y’all rock!🪨
Aight I passed this off to the maintainers, honestly you will have to either manually write the inference Type logic or just hard cast it for now until this wiring gets fixed.
Installing prisma latest (5.9.1) seems to fix the issue
I ran into this issue on a new project and after a couple of hours as a last resort I downloaded the latest version of VSCode and the issue went away. It appears to have been an IDE issue not a prisma issue. Hope this helps!
Me too. In my case the TS server was working, but the ESLint was throwing "as any" everywhere in my code. I ended up disabling a lot of rules(that i usually use) and i could work in peace. Today i got back to the project, enabled all the rules and the error wasn't there anymore. I have no idea what is causing the issue.
I also tried create-t3-app today the same way as the issue, and the error was not there.
Might be depending on which pnpm version you’re using since some lower v8 versions installs the lowest matching range