Type issue in monorepo setup

Hi, I'm in a monorepo setup with bun and prisma

I get this error when defining the auth module

The inferred type of 'auth' cannot be named without a reference to '.bun/@better-auth+core@1.3.32+291433d3a1a8a313/node_modules/@better-auth/core/db/adapter'. This is likely not portable. A type annotation is necessary.ts(2742)


Here is my full file

import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import { expo } from "@better-auth/expo";
import prisma from "../../prisma";

export const auth = betterAuth({
database: prismaAdapter(prisma, {
provider: "postgresql",
}),
trustedOrigins: [process.env.CORS_ORIGIN || "", "my-better-t-app://"],
emailAndPassword: {
enabled: true,
requireEmailVerification: false,
},
user: {
additionalFields: {
role: {
type: "string",
required: false,
input: false,
unique: true,
returned: true,
},
},
},
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
httpOnly: true,
},
},
plugins: [expo()],
});
Was this page helpful?