Skip to content
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

Files not generated with Preview-Feature prismaSchemaFolder #95

Open
timreibe opened this issue Jul 30, 2024 · 1 comment
Open

Files not generated with Preview-Feature prismaSchemaFolder #95

timreibe opened this issue Jul 30, 2024 · 1 comment

Comments

@timreibe
Copy link

timreibe commented Jul 30, 2024

Bug description

I'm using the Preview-Feature prismaSchemaFolder to have multiple schema files in dictionary prisma/schema.

However, when I run npx prisma generate, the output folder for the zod-files is created, but is empty.

How to reproduce

  1. Create directory prisma/schema
  2. Create schema.prisma file with following content:
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["prismaSchemaFolder"]
}

generator zod {
  provider          = "prisma-zod-generator"
  output            = "./generated-zod-schemas"
  isGenerateSelect  = true
  isGenerateInclude = true
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
  posts Post[]
}

model Post {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
  title     String
  content   String?
  published Boolean  @default(false)
  viewCount Int      @default(0)
  author    User?    @relation(fields: [authorId], references: [id])
  authorId  Int?
  likes     BigInt
}
  1. run npx prisma generate
  2. folder generated-zod-schemas was created but is empty

Expected behavior

I'd expect the zod-files to be created.

The exact same prisma.schema file works without previewFeature flag prismaSchemaFolder

Prisma information

See above

Environment & setup

  • OS: MacOs
  • Database: PostgreSQL
  • Node.js version: v22.0.0

Prisma Version

prisma                  : 5.17.0
@prisma/client          : 5.17.0
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v22.0.0
Query Engine (Node-API) : libquery-engine 393aa359c9ad4a4bb28630fb5613f9c281cde053 (at node_modules/prisma/node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine           : schema-engine-cli 393aa359c9ad4a4bb28630fb5613f9c281cde053 (at node_modules/prisma/node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm             : @prisma/prisma-schema-wasm 5.17.0-31.393aa359c9ad4a4bb28630fb5613f9c281cde053
Default Engines Hash    : 393aa359c9ad4a4bb28630fb5613f9c281cde053
Studio                  : 0.502.0
Preview Features        : prismaSchemaFolder
@polesapart
Copy link

it seems like any previewFeature has the same behavior; Here I have:
previewFeatures = ["relationJoins"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants