Next.js Discord

Discord Forum

Prisma Client

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.

why it always appear? this is my lib/prisma.ts :

import { PrismaClient } from "@prisma/client";

const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };

export const prisma = globalForPrisma.prisma || new PrismaClient();

if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;

2 Replies

it tells you the fix in the error itself
run "prisma generate"