From 275f419a41a832e94ea0a9a24b63eadff36ef22c Mon Sep 17 00:00:00 2001 From: AlexIves16 Date: Sun, 26 Apr 2026 17:59:27 +0500 Subject: [PATCH] fix: use default import for @prisma/client CommonJS compat --- app/server/utils/prisma.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/server/utils/prisma.ts b/app/server/utils/prisma.ts index cc9d98b..d7c71a9 100644 --- a/app/server/utils/prisma.ts +++ b/app/server/utils/prisma.ts @@ -1,8 +1,9 @@ -import { PrismaClient } from '@prisma/client' +import PrismaPkg from '@prisma/client' +const { PrismaClient } = PrismaPkg -const globalForPrisma = globalThis as unknown as { prisma: PrismaClient } +const globalForPrisma = globalThis as unknown as { prisma: InstanceType } -export const prisma = globalForPrisma.prisma ?? new PrismaClient({ +export const prisma = globalForPrisma.prisma || new PrismaClient({ log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'] })