Next.js Discord

Discord Forum

Working with prisma and next.js monorepo structure.

Unanswered
Olive-backed Pipit posted this in #help-forum
Open in Discord
Olive-backed PipitOP
First and foremost I'm sorry if this does not belong here, I was not sure since I feel this is the way next.js is structured so I though I will post this issue here. Please let me know if this does not belong here and where would it be better to post this.

I have a monorepo with 2 projects. One is type "application" and one is type "library".
In my "application" project I have prisma and I'm using trpc for api calls.

I would like to use trpc and prisma inside my "library" project within various components, but I am not able to. So while I can import components from "library" to "application" I am not able to import anything from "application" to "library".

I've found something that I thought would help: https://www.prisma.io/docs/guides/other/troubleshooting-orm/help-articles/nextjs-prisma-client-monorepo

However the plugin should be injected inside application that has next.config.js but my "library" does not have next.config.js

What would be the best way to solve this so trpc can be used from any project.

0 Replies