Skip to content

Commit c7409f3

Browse files
twinhThangHuuVu
andauthored
fix(adapter-prisma): import PrismaClientKnownRequestError for edge runtime compatibility (#12755)
fix(prisma): import `PrismaClientKnownRequestError` from prisma client Co-authored-by: Thang Vu <[email protected]>
1 parent 6a0fa0c commit c7409f3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/adapter-prisma/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
*
1616
* @module @auth/prisma-adapter
1717
*/
18-
import { type PrismaClient } from "@prisma/client"
19-
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library"
18+
import { Prisma, type PrismaClient } from "@prisma/client"
2019
import type {
2120
Adapter,
2221
AdapterAccount,
@@ -90,7 +89,7 @@ export function PrismaAdapter(
9089
// If token already used/deleted, just return null
9190
// https://www.prisma.io/docs/reference/api-reference/error-reference#p2025
9291
if (
93-
error instanceof PrismaClientKnownRequestError &&
92+
error instanceof Prisma.PrismaClientKnownRequestError &&
9493
error.code === "P2025"
9594
)
9695
return null

0 commit comments

Comments
 (0)