Closed celloman1929 closed 5 months ago
There had been break changes on TS 5.3.
Upgrade typia to the latest version, and try npx typia setup
command.
Upgraded typia
to 5.3.2, still not working 😭
I separated schema changes and applied them literally line by line. And I realised adding unique constraint to a certain table is triggering this sudden typia error. Even there are other tables with @@unique
set, this particular table is making troubles.
I guess I'll have to compare and look into generated source codes more thoroughly.
If I ever find the reason, I'll leave another comment here. But just letting you know there are some cases when typia cannot transform some kind of types.
The @@unique
constraints does not affect to the validation.
Run tsc
command and tell me which message comes.
The
@@unique
constraints does not affect to the validation.
Yeah, I know it doesn't make sense at all.
Running tsc
has no error, so I may be wrong saying that transform has some problem. I've compared generated codes – literally all generated codes by prisma migrade
, but couldn't find any potential flaws.
This leaves the another case that it might be import problem under .prisma
. Native types in @prisma/client
like Prisma.JsonObject
works fine, but not schema generated types which are imported from .prisma
. Prisma's operation works – doing stuffs with new table – but, typia is not. So, I assume something inside typia related to runtime import has potential flaws. I wish I could create a reproduction so that you can look into it as this part is what I cannot do.
Don't be offended. I'm not blaming typia nor you for this issue. I know how it sounds ridiculous to see an issue which doesn't make sense and cannot be reproducible. I love typia and I'm detouring not using unique constraints for this table. So nobody has problem now. Like I said before, just reporting some unknown bug that might happen again in the future.😁
I think you'd better to provide reproducible repo with researching.
I'm also using prisma
, but could not experienced such unique constraint related bug.
prisma
, typia
, nestia
and typescript
versions to be the latest onenpx typia setup
commandIf nothing be fixed after such trials, then consider inviting me to the private repo.
First, I failed to create a reproduction. This issue seems not reproducible unless I share our private repo.
I use
typia
for runtime type checking in place of manual typeguards, and often use with prisma types which are generated under@prisma/client
. However, today I had some major updates in prisma schema, and made a new migration. After this migration, all typia validations using prisma generated types are emitting error saying"no transform has been configured"
.For example, above code used to work, but after migration its not working. Other validations using other types are working fine at the same moment. So this is prisma specific problem with typia.
I upgraded typescript and typia version to latest today, but I confirmed this error is happening in previous versions – typescript@5.2.2 & typia@5.2.6. I've cloned and reset commits migrating multiple times, but prisma migration is the only case triggering this error. I've tried cleaning node_modules, or using npm or yarn for the package manager, but whenever I migrate the updated schema typia stops working with prisma generated types.
Is there any similar issue you are aware of? Or any guess for this happening?
Here's my tsconfig