P
Prisma2mo ago
Franck

Linter error - multi file schema

Since I use the multi file schema, the linter show this error for all the models + db and client :"The generator "client" cannot be defined because a generator with that name already exists." / The model "x" cannot be defined because a model with that name already exists. How can I get rid of it ?
6 Replies
Prisma AI Help
Prisma AI Help2mo ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
Aman
Aman2mo ago
Can you show me your schema files?
Franck
FranckOP2mo ago
Yes, here are the prisma schema folder, the prisma.config file and the main schema.prisma file where I added the generator and the datasource as recommended in the doc.
No description
No description
No description
Aman
Aman2mo ago
make a schema folder prisma/schema put all the schema files here make your prisma.config.ts like this
export default {
schema: path.join("prisma", "schema"),
migrations: {
path: path.join("prisma", "migrations"),
},
} satisfies PrismaConfig;
export default {
schema: path.join("prisma", "schema"),
migrations: {
path: path.join("prisma", "migrations"),
},
} satisfies PrismaConfig;
also you using the old generator try this instead
generator client {
provider = "prisma-client"
output = "../generated"
engineType = "client"
}
generator client {
provider = "prisma-client"
output = "../generated"
engineType = "client"
}
Franck
FranckOP2mo ago
Updating to the new no-rust engine seemed to work. Thanks for your help

Did you find this page helpful?