chrishoermann / zod-prisma-types

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

[BUG] some inputTypeSchemas are generated with broken import path #206

Closed controversial closed 7 months ago

controversial commented 7 months ago

Describe the bug After upgrading from 2.8.1 to 3.1.1, zod-prisma-types generates a file called inputTypeSchemas/JsonNullValueFilterSchema.ts which contains an import to @prisma/client (which breaks) whereas other files contain relative imports of ../../client (appropriate for my file structure).

This file’s codegen appears to be ignoring the prismaClientPath variable (whether it’s passed manually, or whether it’s “inferred”).

Screenshots Here you can see the side-by-side of two files generated in the same folder. The left-hand file contains a broken import (as suggested by the red underline) and the import in the right-hand file is correct.

Screenshot 2023-11-10 at 11 58 42 AM

Package versions (please complete the following information):

Additional context The @prisma/client import does not work in my environment because i generate multiple prisma clients for two separate databases, and I have configured the generated clients to appear outside of node_modules.