After extending a Prisma Client with Accelerate to use Prisma in edge environment, the Prisma Adapter throws an error, saying that the argument passed is not correct or 'PrismaClient<PrismaClientOptions, never, DefaultArgs>', and is missing the $on and $use properties.
Adapter type
@auth/prisma-adapter
Environment
System: OS: macOS 14.2 CPU: (8) arm64 Apple M1 Memory: 101.66 MB / 8.00 GB Shell: 5.9 - /bin/zsh
Binaries: Node: 18.17.0 - ~/.nvm/versions/node/v18.17.0/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 9.6.7 - ~/.nvm/versions/node/v18.17.0/bin/npm
Browsers: Chrome: 120.0.6099.109 Safari: 17.2
npmPackages: @auth/prisma-adapter: ^1.0.11 => 1.0.11 next: 14.0.4 => 14.0.4 next-auth: ^4.24.5 => 4
Reproduction URL
https://github.com/jeremy-code/example-prisma-accelerate-adapter
Describe the issue
After extending a Prisma Client with Accelerate to use Prisma in edge environment, the Prisma Adapter throws an error, saying that the argument passed is not correct or 'PrismaClient<PrismaClientOptions, never, DefaultArgs>', and is missing the
$on
and$use
properties.Similar issue has been raised in
prisma/prisma
in issue: https://github.com/prisma/prisma/issues/22050: Type issues with prisma accelerate.Issue occurs on both NextAuth.js v4 and Auth.js v5.
Error thrown is:
How to reproduce
any
) and extend it with Accelerate:PrismaAdapter
, which results in TypeErrorExpected behavior
No TypeError should have happened instead of what actually happened.