both betterAuth and createAuthClient throw annotations errors.
The inferred type of 'betterAuthClient' cannot be named without a reference to '@/node_modules/better-auth/dist/shared/better-auth.BAfIsot3'. This is likely not portable. A type annotation is necessary.ts(2742)
The inferred type of 'auth' cannot be named without a reference to '@/node_modules/better-auth/dist/shared/better-auth.BAfIsot3'. This is likely not portable. A type annotation is necessary.ts(2742)
Solution
Just dealing with this myself, you can: 1. if your project is not a library, set
declaration
declaration
and
declarationMap
declarationMap
to false in your tsconfig 2. if it is a library, you're probably exporting a function that needs it's return type annotated. Good thread with some solutions here: https://github.com/pnpm/pnpm/issues/6089
I have an issue in my monorepo using pnpm and typescript, which started to occur after my migration from yarn to pnpm. Here is the gist of how to reproduce the issue Package @my-app/lib-b package h...