#Multiple prisma clients in nest monorepo

2 messages · Page 1 of 1 (latest)

torpid idol
#

Hi, I'm trying to generate a prisma client for each app of my nestjs monorepo. So they wouldn't be sharing a lib, rather each nestjs app would have its own prisma client

Everything works fine with generating it, I generated it to a folder in each service like so:

generator client {
  provider = "prisma-client-js"
  output   = "../src/prisma/generated/client"
}

I can then import everything as usual. However, when I try to run it, it gives this error:

Error: Cannot find module './generated/client/index.js'.

This is because it wasn't compiled to the the /dist folder. How do I make it so that it compiles it? I am sure it's included in the tsconfig

torpid idol
#

I solved it!!

Instead of generating the client in src/, I generated it inside the prisma folder at the root of the app