djbalinD
Convex Community17mo ago
2 replies
djbalin

[Convex Auth]: convexAuth() causes "Type instantiation is excessively deep and possibly infinite."

We get the Type instantiation is excessively deep and possibly infinite. error on our api object whenever we export our Convex auth stuff from auth.ts, e.g. with this simple example:

import { convexAuth } from '@convex-dev/auth/server';
import { Password } from '@convex-dev/auth/providers/Password';

export const { auth, signIn, signOut, store } = convexAuth({
  providers: [Password],
  session: {
    totalDurationMs: 1000 * 60 * 60 * 24 * 30, // 90 days
    inactiveDurationMs: 1000 * 60 * 60 * 24 * 7, // 7 days
  },
});


If we remove export from the above (such that it does not occur in our Convex generated files), our api type instantiation is not excessively deep.
Was this page helpful?