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.

fix prisma warnings

Sara Vieira9476f9570170
diff --git a/app/auth/login.tsx b/app/auth/login.tsx
index 1427155342..a3528afe0b 100644
--- a/app/auth/login.tsx
+++ b/app/auth/login.tsx
@@ -67,7 +67,7 @@ export const Login = () => {
minLength={2}
required
autoFocus
- placeholder="Place your AUTH_SECRET"
+ placeholder="Place your auth secret here"
/>
</Form>
) : (
diff --git a/app/shared/db/prisma.server.ts b/app/shared/db/prisma.server.ts
index 97307d82cb..045640bef6 100644
--- a/app/shared/db/prisma.server.ts
+++ b/app/shared/db/prisma.server.ts
@@ -1,16 +1,14 @@
-import {
- PrismaClient,
- Prisma,
- PrismaClientKnownRequestError,
-} from "@webstudio-is/sdk/lib/prisma.server";
+import { PrismaClient, Prisma } from "@prisma/client";
+import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
-export const prisma = new PrismaClient();
-export { Prisma, PrismaClientKnownRequestError };
+declare global {
+ // allow global `var` declarations
+ // eslint-disable-next-line no-var
+ var prisma: PrismaClient | undefined;
+}
+
+export const prisma = global.prisma || new PrismaClient();
-const main = async () => {
- await prisma.$connect();
-};
+if (process.env.NODE_ENV !== "production") global.prisma = prisma;
-main().catch((error) => {
- throw error;
-});
+export { Prisma, PrismaClientKnownRequestError };