chrishoermann / zod-prisma-types

Generator creates zod types for your prisma models with advanced validation
Other
578 stars 43 forks source link

[BUG] extendedDMMFModel_1.ExtendedDMMFModelClass is not a constructor after upgrade from 2.7.9 to 2.8.1 #202

Closed EdwardDrapkin closed 7 months ago

EdwardDrapkin commented 7 months ago

Describe the bug Package is broken with error after upgrading:


Prisma schema loaded from libs/api-contracts/database/schema.legacy.prisma
Error:
extendedDMMFModel_1.ExtendedDMMFModelClass is not a constructor

Package versions (please complete the following information):

Additional context Add any other context about the problem here.

There is no exported ExtendedDMMFModelClass from the generated node_modules/zod-prisma-types/dist/classes/extendedDMMFModel.js

chrishoermann commented 7 months ago

@EdwardDrapkin thanks for reporting the issue. Can you please try and delete the node modules folder and reinstall all dependencies. The ExtendendDMMFModelClass was moved to the index.js in the folder. So it seems the generator looks in the wrong place.

please also be aware that the latest zod version still has issues with the generated zod schemas. So please use zod version 3.21.1 until the issue is resolved.