diff --git a/pkgs/utils/prisma.ts b/pkgs/utils/prisma.ts index 6407efe..cab0df6 100644 --- a/pkgs/utils/prisma.ts +++ b/pkgs/utils/prisma.ts @@ -8,8 +8,12 @@ export const preparePrisma = async () => { if (!(await existsAsync(dir("node_modules/.prisma")))) { await $({ cwd: dir(`app/db`) })`bun prisma generate`; } - const { PrismaClient } = await import("../../app/db/db"); - g.db = new PrismaClient(); + try { + const { PrismaClient } = await import("../../app/db/db"); + g.db = new PrismaClient(); + } catch (e) { + console.log("Prisma not initialized"); + } } g.dburl = process.env.DATABASE_URL || "";