LogLevel
enum conflicts with built-in Prisma type
#20031
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: enum
"type"/block `enum`
topic: type-clash
Milestone
Bug description
I created an enum called
LogLevel
and used in my model. Model's create type is different than LogLevel enum type. So, this:fails typescript with
Type '"INFO"' is not assignable to type 'LogLevel'. Did you mean '"info"'?ts(2820)
When I change enum name to
Level
types are correct.How to reproduce
prisma
and@prisma/client
and init + create + migrate enum and modelType '"INFO"' is not assignable to type 'LogLevel'. Did you mean '"info"'?ts(2820)
Level
and migrate + generate again to see no error withLevel.INFO
now.Expected behavior
Generated types should be correct regardless
enum
's namePrisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: