Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

add comment explaning prisma changes

Sara Vieiraf3846eecaf29
diff --git a/app/shared/db/prisma.server.ts b/app/shared/db/prisma.server.ts
index 045640bef6..e56bcdb8cf 100644
--- a/app/shared/db/prisma.server.ts
+++ b/app/shared/db/prisma.server.ts
@@ -7,6 +7,9 @@ declare global {
var prisma: PrismaClient | undefined;
}
+// this fixes the issue with `warn(prisma-client) There are already 10 instances of Prisma Client actively running.`
+// explanation here
+// https://www.prisma.io/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices
export const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV !== "production") global.prisma = prisma;