We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6daf6f commit 1876eeeCopy full SHA for 1876eee
lib/javascript/quiz-app/src/lib/prisma.ts
@@ -5,10 +5,11 @@ let prisma: PrismaClient;
5
if (process.env.NODE_ENV === 'production') {
6
prisma = new PrismaClient();
7
} else {
8
- if (!global.prisma) {
9
- global.prisma = new PrismaClient();
+ const globalWithPrisma = global as typeof globalThis & { prisma?: PrismaClient };
+ if (!globalWithPrisma.prisma) {
10
+ globalWithPrisma.prisma = new PrismaClient();
11
}
- prisma = global.prisma;
12
+ prisma = globalWithPrisma.prisma;
13
14
15
export default prisma;
0 commit comments