Open victorsmits opened 1 year ago
Hello I have update my project to the latest version and now I have an other issue it seams that the repositories are not instantiate and thus its impossible to call them.
"TypeError: Cannot read properties of undefined (reading 'findMany')\n" + ' at MessengerGroupsRepository.findMany (C:\Users\victo\Documents\21JumpClick\tablet-api\node_modules\@tsed\prisma\lib\cjs\.schema\repositories\MessengerGroupsRepository.js:37:43)\n' + ' at MessengerController.getGroup (C:\Users\victo\Documents\21JumpClick\tablet-api\src\controllers\rest\messenger.controller.ts:74:32)\n' + ' at C:\Users\victo\Documents\21JumpClick\tablet-api\node_modules\@tsed\platform-params\src\builder\PlatformParams.ts:57:36'
@victorsmits are you sure you have updated all dependencies correctly? Because I haven’t deployed fix on prisma. There is no change.
Yes all my dependencies are up to date.
I suggest you to create repository to reproduce the issue. Also can bump your packages progressively to find the version responsible to your issue. see you
All works for me: https://github.com/tsedio/tsed-example-prisma
DB start and serialization works. But I haven't tested your specific use case. I'll try to create the same case.
Note: Problem around the prisma schema when the table name is on snake case format
I encountered the same problem when dealing with models in snake_case. In my case, I was able to resolve the issue by using the @@map
attribute in Prisma, which allowed me to utilize the repositories generated. I mapped my model example_table to exampleTable as follows:
model exampleTable {
id Int @id @default(autoincrement())
uid String @unique @default(uuid())
created_at DateTime @default(now())
updated_at DateTime @updatedAt
method Method
@@map("example_table")
}
This approach allowed me to keep the snake_case table name while using a camelCase model name.
The response serialization is not working when you get data through the generated prisma repository but work as expected when you pass by the prisma service
Information
A few sentences describing the overall goals of the issue.
Example with prisma repository
response
Example with prisma service
response