Next.js Discord

Discord Forum

Does anyone here use multiple Prisma clients and schemas within Nextjs?

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Because of the bundling of Next.js, the current solution (the one I found anyway) is to hide the clients you have on the node_modules folder so that Next doesn't find it and compiles it. Here's the fix being mentioned: https://github.com/prisma/prisma/issues/18069

Is there any other way around this?

8 Replies

Barbary LionOP
up
Lesser Goldfinch
Just curious, why do you need multiple prisma clients/schemas ?
Barbary LionOP
Because I have two databases
@Lesser Goldfinch Sorry for the late response
My application works with a "central" database and a "client" database, both with different data that correlate and are used together.
Barbary LionOP
up
Barbary LionOP
up
Barbary LionOP
up 😢