Repository navigation
Description
Bug description
I have a monorepo using pnpm that matches the setup from this example:
However, types aren't exported from the peer package when being used in the consuming package - even in the official prisma example shown above. The client functions correctly and returns results, but the exported client is simply of type "any", which is a major nuisance when authoring code with the client.
I've tried importing directly from the dist folder from within the prisma package in the repo and the types are correct when doing intra-package imports. The issue is only when importing from a sibling package within the monorepo. I suspect that makes this a typescript issue, but I don't know how to resolve it and would love for the example project to be updated correctly.
Severity
🔹 Minor: Unexpected behavior, but does not block development
Reproduction
- Clone the prisma-examples repo
cd generator-prisma-client/nextjs-starter-webpack-monorepopnpm install && pnpm run build- Open
packages/next-app/lib/utils/query.tsinside your IDE, hover over theprismaimport and observe that it has a type of "any"
Expected vs. Actual Behavior
Expected proper types on prisma client exported from monorepo package, but getting "any" instead.
Frequency
Consistently reproducible
Does this occur in development or production?
Only in development (e.g., CLI tools, migrations, Prisma Studio)
Is this a regression?
No
Workaround
No workaround, but the client behaves as expected despite the types not being exported correctly.
Prisma Schema & Queries
import prisma from '@/lib/db'
export const getQuotes = async () => {
const start = Date.now()
// `prisma` is of type "any" so there's no completions for these methods or the response
const result = await prisma.quotes.findMany({
orderBy: {
id: 'desc',
},
take: 1,
})
return {
data: result,
}
}
export const addQuote = async (quote: string) => {
// Same here
return await prisma.quotes.create({
data: {
quote,
},
})
}Prisma Config
// See: https://www.prisma.io/docs/orm/prisma-schema/overview/generators#field-reference-1
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
previewFeatures = ["driverAdapters", "queryCompiler"]
}Logs & Debug Info
// Debug logs here
Environment & Setup
- OS: macOS
- Database: PostgreSQL
- Node.js version: 22.16.0
Prisma Version
6.11.1
Activity
FGoessler commentedon Aug 6, 2025
Hi @davidthor 👋
I was not able to reproduce your issue with the current setup other than by NOT generating the client code in the first place. Can you please check back how it behaves with the latest versions of Prisma (6.13.0) and ensuring that the generated code is up to date and your
prismaand@prisma/clientversions are in sync?jkomyno commentedon Aug 6, 2025
I also can't reproduce this:
Please double check the following files in your project, and compare them with our examples to see if there's something missing in your project:
package.jsonin the package containing your Prisma definitionstsconfig.jsonfiles referenced by your monorepojkomyno commentedon Aug 17, 2025
We're closing this issue for inactivity. It is not reproducible in its current state anyway.