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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
findUnique
used with Promise.all
returns null
#18096
Comments
Just lost my mind over this, thank you ❤️ |
This is also an issue when trying to use |
Also running into this - seems like a pretty significant issue. Seeing the issue on 4.7.1. |
I can confirm this observation with the provided reproduction repository. Thanks for that @thomasjiangcy. |
I can reproduce this when the type of id is |
Not sure if this is related, but after upgrade to 4.10.0+ I'm seeing Edit: Just saw @EduardoBautista's comment regarding batching, which I am using. Surprised this is being seeing on versions 4.9.0 and below, though. |
We're having the same issue since upgrading to 4.10. Is there a way to disable the batching? |
I'm seeing this issue on prisma version 5.1.1 Update: This is enum related |
Can you open a new issue @moishinetzer, optimally with a reproduction so we can observe this ourselves? Thanks. |
Sorry for not updating: It seems to be resolved now. My dependencies weren't matching between prisma and @prisma/client thanks for the help. |
Bug description
There is an unexpected behaviour with
.findUnique()
andPromise.all()
similar to #4438.When used together, it returns an array of
null
:However, using
.findUniqueOrThrow()
withPromise.all()
seems to work as expected.How to reproduce
Here's a minimally reproducible repository - https://github.com/thomasjiangcy/prisma-promise-all-find-unique-bug
npm install
docker compose up -d
(if you have docker compose installed, if not you can run postgres another way)npx prisma migrate dev
npx ts-node index.ts
Output of
DEBUG='*' npx ts-node index.ts
Expected behavior
Using
.findUnique()
withPromise.all()
should return an array of unique objects.Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: