h3llo
h3llo
Explore posts from servers
PPrisma
Created by h3llo on 4/11/2025 in #help-and-questions
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.
4 replies
TtRPC
Created by h3llo on 12/26/2024 in #❓-help
subscription tracked returns a 3-tuple to frontend instead of object
I am using tracked as per recommendation in https://trpc.io/docs/server/subscriptions#tracked like this:
for await (const [eventData] of iterable) {
yield tracked(eventData.jobId, eventData);
}
for await (const [eventData] of iterable) {
yield tracked(eventData.jobId, eventData);
}
It's properly typed on both frontend and backend, eg:
{
id: string;
data: someObject;
}
{
id: string;
data: someObject;
}
however what I actually receive on frontend is an 3-tuple [id, data, null]. I tried this both on versions "11.0.0-rc.666" and next and got the same results.
3 replies