'then' in PrimsaPromise
returns false
#12252
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
tech/typescript
Issue for tech TypeScript.
topic: fluent api
topic: prisma-client
Milestone
Bug description
Some libraries use
'then' in x
as part of their detection for promise-like/thenable objects.The way prisma client builds its fluent APIs with proxies causes this to fail.
How to reproduce
console.log('then' in prisma.someModel.findUnique({ where: { id: 1 }))
console.log(typeof prisma.someModel.findUnique({ where: { id: 1 })).then === 'function')
This is basically because ownKeys here
prisma/packages/client/src/runtime/core/model/applyFluent.ts
Line 106 in 3855438
then
(or other promise methods)Expected behavior
'then' in promise
should return true.Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: