Closed MichaelOren closed 1 year ago
im also running t3 and i got this error when installing in an existing repo: Steps: npm install zod-prisma-types
add to prisma schema
generator zod {
provider = "zod-prisma-types"
}
$ prisma db push
Debugger attached.
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "db" at "127.0.0.1:3306"
The database is already in sync with the Prisma schema.
Running generate... (Use --skip-generate to skip the generators) Error: Generator at zod-prisma-types could not start:
/bin/sh: zod-prisma-types: command not found
@MichaelOren thanks for the report! There ist a known issue with the latest version of zod. See #98. which Version of zod ist currently installed in a blank t3 Stack? Maybe this ist the cause dir this Bug?
@fotoflo This seems to bei some other bug. I'll look into it.
Thanks for the quick response!
This is from the package.json
"zod": "^3.21.4",
"zod-prisma-types": "^2.5.1"
Confirmed rolling back to zod
to 3.21.1 got it working 😄
Closing this issue as duplicate of 98
Rolling back zod to 3.21.1
helped me too. Looking forward for the fix of #98, but so far I am very pleased by this package and it helps a lot.
I also just noticed the known issues reference in the Readme.md
, but I missed it the first time and found this issue first.
Hey Chris,
Thanks for your work!
I can't seem to get it to work with a blank T3 stack out of the box
Outputted Prisma Schema
```prisma // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { provider = "prisma-client-js" } datasource db { provider = "sqlite" // NOTE: When using postgresql, mysql or sqlserver, uncomment the @db.Text annotations in model Account below // Further reading: // https://next-auth.js.org/adapters/prisma#create-the-prisma-schema // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string url = env("DATABASE_URL") } generator zod { provider = "zod-prisma-types" } model Example { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } // Necessary for Next auth model Account { id String @id @default(cuid()) userId String type String provider String providerAccountId String refresh_token String? // @db.Text access_token String? // @db.Text expires_at Int? token_type String? scope String? id_token String? // @db.Text session_state String? user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@unique([provider, providerAccountId]) } model Session { id String @id @default(cuid()) sessionToken String @unique userId String expires DateTime user User @relation(fields: [userId], references: [id], onDelete: Cascade) } model User { id String @id @default(cuid()) name String? email String? @unique emailVerified DateTime? image String? accounts Account[] sessions Session[] } model VerificationToken { identifier String token String @unique expires DateTime @@unique([identifier, token]) } ```npm install
works fine and outputs the zod schemas fine.After running
npm run build
I get the following error:I have no idea how to debug this error 😅 , any help would be appreciated 🙏
Reproduction instructions
Run `npm create t3-app@latest` and follow the prompts, select all of the options (prisma, trpc, nextauth and tailwind) Install this package (`npm install zod-prisma-types`) `npm i` and then `npm run build`