Better Auth]: [#better-auth]: Couldn't read your auth config.

app git:(master) 15:10 npx @better-auth/cli generate 2025-04-15T19:11:29.250Z ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. at new PrismaClient (C:\Users\mehul\Desktop\Coding\Gridlock\app\node_modules\.prisma\client\default.js:43:11) I am getting this error and I am not sure what I am doing wrong. MY prisma config import { PrismaClient } from "@prisma/client"; const globalForPrisma = globalThis as unknown as { prisma: PrismaClient }; export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: ["query", "info", "error", "warn"], }); if (process.env.NODE_ENV !== "production") { globalForPrisma.prisma = prisma; } My packages @prisma/client": "^6.6.0", "better-auth": "^1.2.7", "prisma": "^6.6.0",
1 Reply
KiNFiSH
KiNFiSH3w ago
can you show me your schema prisma file ? probably if you are using custom path for prisma clinet generation please use that for auth config of better auth.

Did you find this page helpful?