Support for Prisma 4.x
Alexandre-Fernandez opened this issue · 2 comments
Alexandre-Fernandez commented
It works perfectly on 3.15.2, but throws this error after running pnpm prisma generate
on 4.0.0 :
Environment variables loaded from .env
Prisma schema loaded from src/api/database/schema.prisma
Error:
✔ Generated Prisma Client (4.0.0 | library) to ./node_modules/.pnpm/@prisma+client@4.0.0_prisma@4.0.0/node_modules/@prisma/client in 53ms
TypeError: Cannot read properties of undefined (reading 'enumTypes')
at Object.generate [as onGenerate] (.../node_modules/.pnpm/prisma-joi-generator@0.1.1_prisma@4.0.0/node_modules/prisma-joi-generator/lib/prisma-generator.js:45:36)
at async LineStream.<anonymous> (.../node_modules/.pnpm/@prisma+generator-helper@3.15.0/node_modules/@prisma/generator-helper/dist/generatorHandler.js:33:24)
omar-dulaimi commented
Hey @Alexandre-Fernandez
Thanks for using my project, I appreciate it.
Yes, indeed there has been a breaking change in Prisma internals. It looked a minor change judging by the release notes.
I'm planning to dedicate some time to upgrade this generator and all other generators I have.
Hopefully soon enough.
Though if you feel adventurous, you could give it a go. Start by checking the release notes regarding Prisma's internals, that's where you would need to begin.