Naming a model `Promise` breaks types for `PrismaPromise`
Tenrys opened this issue · comments
Bug description
This started happening since Prisma 4.9.0, seemingly since #17265.
How to reproduce
Clone the linked reproduction repository, generate the Prisma schema, and open index.ts
in VSCode. await
will not work on the findMany
query and trying to call map
on the expected awaited array of customers
will give an error.
Expected behavior
No response
Prisma information
Environment & setup
- OS: Manjaro Linux
- Database: PostgreSQL
- Node.js version: v16.17.0
Prisma Version
4.9.0
Same story if you have something in your schema called PromiseType
, in this case an enum. In general it seems like if you're not careful, you could generate types overriding the ones required for the Prisma client types to work properly.
This is fixed and the fix will be published as a part of 5.1 release. You can also check out 5.1.0-dev.25
dev snapshot - we do not recommend using dev snapshots in production, but it should be enough to verify the fix.