P
Prisma3w ago
h3llo

prisma-client provider can't be used with multiple generators

When running the generate command I get an error:
│ Loaded Prisma config from ".....\prisma.config.ts".
│ Prisma config detected, skipping environment variable loading.
│ Prisma schema loaded from prisma\schema
│ Error: Generator "Prisma Json Types Generator" requires generator "prisma-client-js", but it is missing in your schema.prisma.
│ Please add it to your schema.prisma:

│ generator gen {
│ provider = "prisma-client-js"
│ }

│ Loaded Prisma config from ".....\prisma.config.ts".
│ Prisma config detected, skipping environment variable loading.
│ Prisma schema loaded from prisma\schema
│ Error: Generator "Prisma Json Types Generator" requires generator "prisma-client-js", but it is missing in your schema.prisma.
│ Please add it to your schema.prisma:

│ generator gen {
│ provider = "prisma-client-js"
│ }

This is my main schema:
generator client {
provider = "prisma-client"
output = "../generated"
binaryTargets = ["native"]
previewFeatures = ["prismaSchemaFolder"]
}

generator json {
provider = "prisma-json-types-generator"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client"
output = "../generated"
binaryTargets = ["native"]
previewFeatures = ["prismaSchemaFolder"]
}

generator json {
provider = "prisma-json-types-generator"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
The issue is caused by the generator json since when I remove it, it works normally, but I want to use this feature for JSON field type-safety.
3 Replies
Prisma AI Help
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
Nurul
Nurul3w ago
Hey 👋 The problem is that the "prisma-json-types-generator" is specifically designed to work with the traditional prisma-client-js generator, not the newer prisma-client generator (in Early Access). This seems to be a compatibility issue between the two generators. There is a feature request for it: https://github.com/arthurfiorette/prisma-json-types-generator/issues/465
GitHub
Support new "prisma-client" generator · Issue #465 · arthurfioret...
Prisma 6.6.0 introduces "prisma-client" instead of "prisma-client-js" https://github.com/prisma/prisma/releases/tag/6.6.0 generator client { provider = "prisma-client"...
h3llo
h3lloOP3w ago
thanks for the reply, I guess i'll downgrade to 6.5.0 and use the old prisma-client-js without generated directory since none of it is still ready

Did you find this page helpful?