Type instantiation is excessively deep and possibly infinite.

Been getting those type errors everywhere, Nuxt 3 project. It happens on my utils/auth-client.ts (where I create and export a client, just like the docs says) and everywhere else where I import this client.
3 Replies
Medim
MedimOP3mo ago
There's also some inconsistencies in the docs. https://www.better-auth.com/docs/integrations/nuxt#create-api-route Says Create a file inside /server/api called [...auth].ts https://www.better-auth.com/docs/installation#mount-handler If you select the nuxt section, it says to create it on /server/api/auth/[...all].ts What is the right path? does it matter? or does Nuxt redirects /server/api/auth to [...all].ts? a bit confusing On the nuxt specific guide, it also imports 'auth.config' import { auth } from "~/utils/auth.config"; Which throws a ENOENT, correct would be just "~/utils/auth" I'll gladly open a PR to clear those misunderstandings in the docs once we sort it out here
bekacru
bekacru3mo ago
make sure to enable strict:true in your tsconfig server/api/auth/[...all].ts this is the correct path. Will fix the nuxt guide as well. auth.config or just auth is where you actually put your auth config. It doesn't matter it's just there as an example
Medim
MedimOP3mo ago
thanks.

Did you find this page helpful?