Next.js Discord

Discord Forum

Share Zod types using TypeScript Project References

Unanswered
Silky ant posted this in #help-forum
Open in Discord
Silky antOP
Hello, I apologize in advance as I have no idea how to solve my problem with Next.js, and I would need detailed assistance.

I have a Next.js application, a tRPC server, and a folder where I store my Prisma database models and the associated Zod schemas.
I was advised to use TypeScript project references to resolve the Zod types (because without it, the TypeScript loading state is permanent).

How can I make these schemas available in both Next.js and my server ?

[prisma-zod-generator](https://www.npmjs.com/package/prisma-zod-generator)
[typescript-project-references](https://www.typescriptlang.org/docs/handbook/project-references.html)

Thank you for your help and your time 🤍 !

0 Replies