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?
No description
13 Replies
chawnsphone
chawnsphone•5mo ago
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.
No description
chawnsphone
chawnsphone•5mo ago
Any help is greatly appreciated!
chawnsphone
chawnsphone•5mo ago
Even with a brand new T3 app I'm getting this error
No description
JacobMGEvans
JacobMGEvans•5mo ago
What do the Prisma models look like? @julius who's the main maintainer for CT3A?
chawnsphone
chawnsphone•5mo ago
Here's the default from T3
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")

// Do not use foreign keys (PlanetScale does not support them)
relationMode = "prisma"
}

model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@index([name])
}
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
provider = "mysql"
url = env("DATABASE_URL")

// Do not use foreign keys (PlanetScale does not support them)
relationMode = "prisma"
}

model Post {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@index([name])
}
Alexander
Alexander•5mo ago
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
Alexander
Alexander•5mo ago
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...
chawnsphone
chawnsphone•5mo ago
Thanks for looking into this. Y’all rock!🪨
JacobMGEvans
JacobMGEvans•5mo ago
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.
chawnsphone
chawnsphone•5mo ago
Installing prisma latest (5.9.1) seems to fix the issue
hakkub
hakkub•5mo ago
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!
Alky
Alky•5mo ago
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.
julius
julius•5mo ago
Might be depending on which pnpm version you’re using since some lower v8 versions installs the lowest matching range
Want results from more Discord servers?
Add your server
More Posts
Compressing images before uploading to UploadThing?Is there a way we can intercept the incoming upload request and, if they are images, compress them bI am trying to add some developers emails and it is not letting meI am trying to add some of my developers by email and when I do it does not add their email to the eFinance industry compliance (SOC / WORM)Hey all, I'm semi new so I hope it's ok to ask here, but I am a freelancer I recently got approach wwhat should be the best go-to main portfolio fullstack project stack before looking for a job rn?Hi, here's my github profile, with the stack I know on a junior-mid level: https://github.com/WisieGoogle security error on next auth js redirecthey guys, I'm getting a dangerous site error when using next auth js's signing page flow. Has anyoneCode runner using AWS lambda functionHi guys, i want to build code runner using AWS lambda function with custom runtime images for each lShadcn Date Picker dropdown background color ?I have a problem with shadcn's Date picker component - in project that I'm currently building in cusIs it possible to create a component named Home in a NextJS project?As the title states, I've been messing around with this one page I ported over from v0 and named theBest way to handle global state and component stateI want this a state globally. and i want quantity and rate should pass it and calculate it there. whCall post.hello on button clickHi, I know that trpc is using React useQuery under the hood in T3 on the client and therefore can on