mapProfileToUser throwing The inferred type of 'auth' cannot be named without a reference to '../../

I am using a monorepo using turborepo and when i use mapProfileToUser in the oAuth provider options i get this error:
The inferred type of 'auth' cannot be named without a reference to '../../../../node_modules/better-auth/dist/shared/better-auth.Bzjh9zg_'. 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.Bzjh9zg_'. This is likely not portable. A type annotation is necessary.ts(2742)
leading me to be unable to use this function otherwise i get some build errors, i know there is some work arounds but not something i would like to do
4 Replies
Ping
Ping4mo ago
Hello, have you set strict to true in your tsconfig?
Jacob
JacobOP4mo ago
Yes I have, still no success I decided to just use a database hook to get around it as I was just mapping the first name and last name properties
Harry
Harry4mo ago
Hey all, I'm also seeing this issue when using mapProfileToUser in my Turborepo monorepo
The inferred type of 'auth' cannot be named without a reference to '../../../../node_modules/better-auth/dist/shared/better-auth.Bzjh9zg_'. 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.Bzjh9zg_'. This is likely not portable. A type annotation is necessary.ts(2742)
Ping
Ping4mo ago
Make sure that declarations is set to false too.

Did you find this page helpful?