Prisma adapter import path error

Hello everyone, I've started working with Better Auth, but I'm running into an issue with the Prisma adapter. I have the following code: import { betterAuth } from "better-auth"; import { prismaAdapter } from "better-auth/adapters/prisma"; import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); export const auth = betterAuth({ database: prismaAdapter(prisma, { provider: "mongodb", }), emailAndPassword: { enabled: true, }, }); However, when I run npm run dev, I get this error in my terminal: Error: Package subpath './*' is not defined by "exports" in /Users/lympe/Workspace/test/node_modules/better-auth/package.json My IDE indicates that the import path is correct. Does anyone have an idea why this is happening or how to fix it?
4 Replies
Ping
Ping4mo ago
Is there any reason why you aren't using the mogodb adapter ?
lympe
lympeOP4mo ago
I'm using Prisma to define my other models, so it seemed like the right thing to do. Do you think I should use the MongoDB adapter instead? I just tried using the MongoDB adapter, but I'm still getting the same error.
Ping
Ping4mo ago
Try deleting your node_modules and then reinstall packages
lympe
lympeOP4mo ago
I have already tried, and the error persists

Did you find this page helpful?