New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad prisma-client import #9
Comments
Hey @altarrok Sadly, I do not have a Windows machine to try it out. On my Linux machine though, your config worked fine and generated this import: import type { Prisma } from '../../../prisma-client'; So, is it possible that you attempt fixing this? Also, don't forget to star this project if you find it helpful :) |
@omar-dulaimi Yeah sure, I already implemented a fix, I don't have the perms tho, how can I create a PR? thx |
@altarrok |
@omar-dulaimi thanks for the steps, created the PR: #10 |
@altarrok Thanks for your contribution. Any others you have are welcomed, just make sure to start an issue first so we can discuss it :) Released in: https://github.com/omar-dulaimi/prisma-zod-generator/releases/tag/0.4.1 |
Bug description
Generated object schemas have a bad prisma-client import when client output is "../src/generated/prisma-client" and zod output is "../src/generated/zod" in Windows:
How to reproduce
output = "../src/generated/prisma-client"
to client generator config in schema.prismaoutput = "../src/generated/zod"
to zod generator config in schema.prismayarn prisma generate
src\generated\zod\schemas\objects\XCreateInput.schema.ts
import type { Prisma } from '......prisma-client';
Expected behavior
import type { Prisma } from '../../../prisma-client';
Prisma information
generator client {
provider = "prisma-client-js"
output = "../src/generated/prisma-client"
binaryTargets = ["native", "rhel-openssl-1.0.x"]
}
generator zod {
provider = "prisma-zod-generator"
output = "../src/generated/zod"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model X {
id String @id @default(auto()) @Map("_id") @db.ObjectId
}
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: