Empty plugin array throws type inference into a never state
I setup a project recently and noticed I couldn't get inference on my Session types. After some time i figured out that having the plugin array empty on Better-auth's instance setup was the culprit.
here's a minimal repro that should yield a type error from the LSP perceptive.


2 Replies
I have opened a PR for this, let me know what you think.
https://github.com/better-auth/better-auth/pull/4612
GitHub
fix: infer types for empty list plugins correctly by frectonz · Pu...
Make sure the following infer the same types.
const auth = betterAuth({
plugins: []
});
and
const auth = betterAuth({
});
Summary by cubic
Ensure betterAuth({ plugins: [] }) infers the same t...
Seems like the issue was fixed. Cheers bud!