Turborepo & Prisma Environment Variables

Hi, I'm currently setting up my Monorepo with Turborepo and env-vars are... weird.. with it. The problem I'm currently having is, when I'm doing npx prisma db push in my apps/server Folder, it complains about not finding the env file which Turborepo requires to have in the Root of the Workspace. The current "solution" I have is a .env file in the root and the app, but I don't want to update my .env in two places. Thanks in advance!
1 Reply
FluX
FluX2y ago
I'm using the same stack - here's what works for me: My Prisma schema is in apps/api/src/prisma My .env with DATABASE_URL is in apps/api Then, I have this in my api's package.json:
"prisma": {
"schema": "src/prisma/schema.prisma"
}
"prisma": {
"schema": "src/prisma/schema.prisma"
}
I can cd into apps/api and run my Prisma commands from there
Want results from more Discord servers?
Add your server