P
Prisma2mo ago
Daniel

Cannot read properties of undefined (reading 'kind')

Hey, i get the following error, when performing a db action.
[Nest] 43127 - 06/17/2024, 10:06:13 PM ERROR [WsExceptionsHandler] Cannot read properties of undefined (reading 'kind')
TypeError: Cannot read properties of undefined (reading 'kind')
at Ka (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2921)
at Ka (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2938)
at Array.map (<anonymous>)
at Id (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2832)
at wn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:2205)
at Ga (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:308)
at wn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:2423)
at Tn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:6662)
at In.handleRequestError (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:122:6533)
at In.handleAndLogRequestError (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:122:6211)
[Nest] 43127 - 06/17/2024, 10:06:13 PM ERROR [WsExceptionsHandler] Cannot read properties of undefined (reading 'kind')
TypeError: Cannot read properties of undefined (reading 'kind')
at Ka (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2921)
at Ka (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2938)
at Array.map (<anonymous>)
at Id (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:2832)
at wn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:2205)
at Ga (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:308)
at wn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:114:2423)
at Tn (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:115:6662)
at In.handleRequestError (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:122:6533)
at In.handleAndLogRequestError (/Users/daniel/Programmieren/Eigene Projekte/Academi.fy/backend/node_modules/@prisma/client/runtime/library.js:122:6211)
I do NOT know where it comes from exactly, but it happens when modifying the activityContent field on the following:
6 Replies
Daniel
Daniel2mo ago
model ChatActivity {
id String @id @default(uuid()) @db.Uuid
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

chat Chat @relation("ChatActivity", fields: [chatId], references: [id])
chatId String @db.Uuid

executor User @relation("UserChatActivity", fields: [executorId], references: [id])
executorId String @db.Uuid

readBy User[] @relation("ReadChatActivity")

answerTo ChatActivity? @relation("ChatActivityAnswer", fields: [answerToId], references: [id])
answerToId String? @db.Uuid

answeredBy ChatActivity[] @relation("ChatActivityAnswer")

type ChatActivityType
activityContent Json

starred Boolean @default(false)

@@map("activities")
}
model ChatActivity {
id String @id @default(uuid()) @db.Uuid
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

chat Chat @relation("ChatActivity", fields: [chatId], references: [id])
chatId String @db.Uuid

executor User @relation("UserChatActivity", fields: [executorId], references: [id])
executorId String @db.Uuid

readBy User[] @relation("ReadChatActivity")

answerTo ChatActivity? @relation("ChatActivityAnswer", fields: [answerToId], references: [id])
answerToId String? @db.Uuid

answeredBy ChatActivity[] @relation("ChatActivityAnswer")

type ChatActivityType
activityContent Json

starred Boolean @default(false)

@@map("activities")
}
If i remove the activityContent field from the db action, it works fine. Once i add it, the error occurs Anyone any ideas? 😟
Nurul
Nurul2mo ago
Hey! I assume you would be getting this error while invoking a Prisma Client query. Do you have any column named Kind in any of your tables?
Daniel
Daniel2mo ago
No, I do not! Kind is nowhere to be found in the whole project (excluding node_modules). And yes, i am getting this error while invoking a query:
this.prisma.chatActivity.create({
...
});
this.prisma.chatActivity.create({
...
});
Kind comes from library.js:
...
function Ka(e){
return e.kind==="list"?`${Ka(e.elementType)
} ^
...
...
function Ka(e){
return e.kind==="list"?`${Ka(e.elementType)
} ^
...
Nurul
Nurul2mo ago
This is strange. Is your repository open source? Any way I can reproduce this error?
Daniel
Daniel2mo ago
Nurul
Nurul2mo ago
Thanks for creating the bug report. Our engineering team will get back on the GitHub Issue 👍
Want results from more Discord servers?
Add your server
More Posts