-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
TypeScript Error: Type instantiation is excessively deep and possibly infinite when using plugins admin and organization #949
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workinglockedLocked conversations after being closed for 7 daysLocked conversations after being closed for 7 days
Description
Is this suited for github?
- Yes, this is suited for github
To Reproduce
-
Set up a NestJS project with better-auth.
-
Set
declaration: falseandstrict: truein tsconfig.json -
Enable the admin and organization plugins in the configuration:
const auth = betterAuth({
plugins: [admin(), organization()],
});
Current vs. Expected behavior
When using better-auth in a NestJS project, enabling the admin and organization plugins causes TypeScript to throw the following error:
Type instantiation is excessively deep and possibly infinite. (ts2589)
I have already followed the instructions provided in the TypeScript configuration documentation by setting the following options in my tsconfig.json:
{
"compilerOptions": {
"declaration": false,
"strict": true
}
}However, the issue persists. Without enabling these two plugins (admin and organization), everything works perfectly fine.
What version of Better Auth are you using?
1.0.22
Provide environment information
- Framework: NestJS
- typescript: 5.7.2Which area(s) are affected? (Select all that apply)
Types
Auth config (if applicable)
import { betterAuth } from "better-auth"
export const auth = betterAuth({
plugins: [
anonymous(),
admin(),
organization(),
});Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglockedLocked conversations after being closed for 7 daysLocked conversations after being closed for 7 days