-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS: PrismaAdapter does not accept prisma client that has client extensions #6078
Comments
Technically you should not be using v4 yet:
Happy to add support though, so is this just a TS issue? 馃 |
Yes. |
It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks! |
Temporary work around until supported: import { PrismaClient } from "@prisma/client";
export const authOptions: NextAuthOptions = {
adapter: PrismaAdapter(prisma as unknown as PrismaClient),
...
} If necessary could replace |
It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks! |
To keep things tidy, we are closing this issue for now. If you think your issue is still relevant, leave a comment and we might reopen it. Thanks! |
Any update on this? |
This is still an issue I think in the latest version of the adapter |
still facing an error using prisma.$extends. can you help why this is happen? @balazsorban44 , thank you. all of this working fine, if i'm not using prisma extension. |
Fixed by #9798 it seems, for others who arrive here |
Question 馃挰
When using the new prisma client extensions that they introduced in 4.7.0, the type of the prisma client changes with whatever extensions you apply.
If you try to pass your extended prisma client into PrismaAdapter, TS complains about the types not matching what it expects.
For now I have both a standard prisma client and an extended client. I pass the standard client into PrismaAdapter and use the extended client where needed in callbacks and events.
I would prefer that PrismaAdapter accept an extended client so that I don't have import and use both clients in [...nextAuth].ts
How to reproduce 鈽曪笍
Contributing 馃檶馃徑
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered: