annotations forbetterAuth and createAuthClient

It was clean but I think I fuc-ked up typescript by updating it? 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)
No description
No description
Solution:
Just dealing with this myself, you can: 1. if your project is not a library, set declaration and 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...
GitHub
The inferred type of '...' cannot be named without a reference to '...
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...
Jump to solution
2 Replies
Solution
erquhart
erquhart7d ago
Just dealing with this myself, you can: 1. if your project is not a library, set declaration and 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
GitHub
The inferred type of '...' cannot be named without a reference to '...
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...
Emad777
Emad777OP7d ago
It worked! Thank you.

Did you find this page helpful?