Issue installing latest Prisma in Next.js
Hey currently I have duplicates of schema.prisma in all of my APIs I want to create a shared/prisma/schema.prisma in the root of the repo.
I'm installing Prisma in my Next.js project just to use the types. I do all of my database querying on a dedicated website_api on different service provider to be decoupled from Next.js and for security.
I'm running into issues generating the types with Next.js.
All of my web apis use an older version of Primsa I'm going to update.
Right now, I'm installing the lates version of Prisma, again, just for schema model types.
I keep hitting an error. I use PlanetScale.
Does this look correct for the config file? Next.js uses an .env.local file. Not sure if that matters
This ^^^ is in the root of my next/ folder - same level as package.json.
This is my script for this.
Does this look correct?
4 Replies
You selected to wait for the human sages. They'll share their wisdom soon.
Grab some tea while you wait, or check out
#ask-ai if you'd like a quick chat with the bot anyway!ok it was the env.local, I had to do something special with donenv
Actually, can you even have a shared schema in a monorepo?
#ask-ai can I have a shared schema-prisma in a monorepo all of my APIs access?
In a monorepo you'd likely want all your database schemas, definitions etc. in one package, and then expose the package to the rest of the monorepo. And that is entirely possible 🙂
Agreed. Also if you want to interact with the AI bot you can tag
@kapa.ai in the #ask-ai channel and ask your question.