Repository navigation
Open
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.
Description
Bug description
Using prisma transaction client alongside of the prisma client is a common scenario, However I've recently noted that when I want to combine them, the types are not inferred immediately and causes typescript server to lag!!
Consider this code:
export const initPrisma = async (): Promise<PrismaClient> => {
const client = await getPrismaClient(url);
try {
await client.$connect();
console.info('::::Connected to DB::::');
return client;
} catch (error) {
console.error('Cant connect to database: ', error);
} finally {
return client;
}
};
async function something(tx?: Prisma.TransactionClient) {
const client = await initPrisma()
const combinedPrisma = tx ?? client ;
// `combinedPrisma` type takes a considerable time to be inferred
// while `PrismaClient` and `TransactionClient` alone are inferred immediately
}
In the code above when I type combinedPrisma and then . I expect the types/autocompletions get displayed immediately however it takes about 2 seconds in Mac and 5 seconds in Lenovo to show the types. It has been affecting my developer experience significantly!
Severity
🔹 Minor: Unexpected behavior, but does not block development
Reproduction
Expected vs. Actual Behavior
I expected the types get immediately shown however it takes unusual time.
Frequency
Consistently reproducible
Does this occur in development or production?
Only in development (e.g., CLI tools, migrations, Prisma Studio)
Is this a regression?
Don't know.
Workaround
Prisma Schema & Queries
Prisma Config
/// <reference types="node" />
import { defineConfig } from 'prisma/config';
const isTest = process.env.NODE_ENV === 'test';
const dbName = isTest ? 'ERPTEST' : 'ERP';
export default defineConfig({
schema: './schema',
migrations: {
path: './migrations',
},
datasource: {
url:
process.env.DATABASE_URL ??
`postgresql://postgres:password@localhost:5432/${dbName}`,
},
});Logs & Debug Info
None
Environment & Setup
- OS: MacOS Tahoe
- Database: Postgres
- Node.js version: 24
Prisma Version
7.1.0
Reacted by vincentrolfs and yigitahmetsahin
Reacted by coderabbitai and vincentrolfs
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.
Activity
coderabbitai commentedon Dec 27, 2025
📝 CodeRabbit Plan Mode
Generate an implementation plan and prompts that you can use with your favorite coding agent.
Examples
🔗 Similar Issues
Related Issues
prisma-clientprovider #27600👤 Suggested Assignees
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!