P
Prisma5d ago
cwh

VSCode Intellisense completely breaks when adding a relation

Hi all. I've just started using Prisma with Supabase for the first time on a new Next.js project. All was going swimmingly until I added a basic relation to one of my two extremely simple models. Since adding that relation and running npx prisma generate VSCode Intellisense has completely broken, and hovering over anything that used to give me instant Intellisense just pops up "Loading…" that never seems to resolve. This includes non-Prisma related code like basic React components. Removing the relation and re-generating fixes it. Is there something obvious that I'm missing?
generator client {
provider = "prisma-client-js"
}

generator zod {
provider = "zod-prisma-types"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

model Folder {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
name String
diagrams Diagram[]
}

model Diagram {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
name String
folder Folder? @relation(fields: [folderId], references: [id])
folderId Int?
}
generator client {
provider = "prisma-client-js"
}

generator zod {
provider = "zod-prisma-types"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}

model Folder {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
name String
diagrams Diagram[]
}

model Diagram {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
name String
folder Folder? @relation(fields: [folderId], references: [id])
folderId Int?
}
9 Replies
Prisma AI Help
Well met, adventurer! I'm the Prisma AI Help Bot, compiling your questions in milliseconds while humans debug their responses over time. Who’s on your team?
Nurul
Nurul5d ago
Does the issue happen even after you restart TS server in VS Code? After adding the relation and regenerating Prisma Client with npx prisma generate, can you try restarting TS Server? You can do that by pressing Cmd+Shift+P in VS Code and then typing "Restart Ts Server"
cwh
cwhOP5d ago
Yeah it still persists I'm afraid. Worth noting that eventually I do get Intellisense, but we're talking after minutes of waiting. For example, it's been 10 minutes since I generated and I'm still getting no Intellisense. I did finally get Intellisense, it was roughly 20 minutes after restarting the TS server.
Nurul
Nurul5d ago
This is indeed straneg. Are you using latest prisma version - 6.4.1?
cwh
cwhOP5d ago
I am. Also on the latest VSCode (1.97.2).
"@prisma/client": "^6.4.1",
"prisma": "^6.4.1",
"supabase": "^2.12.1",
"zod": "^3.24.2",
"zod-prisma-types": "^3.2.4",
"next": "15.1.7",
"@prisma/client": "^6.4.1",
"prisma": "^6.4.1",
"supabase": "^2.12.1",
"zod": "^3.24.2",
"zod-prisma-types": "^3.2.4",
"next": "15.1.7",
Nurul
Nurul5d ago
Are you on Mac OS?
cwh
cwhOP5d ago
Yes, M2 Pro running Sonoma 14.6.1 I've just tried to run a next build and it gets stuck on the "Linting and checking validity of types". If I remove the relations it completes in a matter of seconds. Is there anything I can send to try and help debug this? If I don't get it fixed soon I'm going to have to migrate away from Prisma.
Nurul
Nurul4d ago
Quick sanity check: The extension version is also the latest one right?
No description
cwh
cwhOP4d ago
It is yeah

Did you find this page helpful?