-
-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
Description and expected behavior
Using an enum in two separate fields of a model breaks Zod generation:
⠙ Running plugin ZodError compiling generated code:
node_modules/.zenstack/zod/models/TwoEnumsOneModelTest.schema.ts:4:10 - error TS2300: Duplicate identifier 'InventoryUnitSchema'.
4 import { InventoryUnitSchema } from '../enums/InventoryUnit.schema';
~~~~~~~~~~~~~~~~~~~
node_modules/.zenstack/zod/models/TwoEnumsOneModelTest.schema.ts:5:10 - error TS2300: Duplicate identifier 'InventoryUnitSchema'.
5 import { InventoryUnitSchema } from '../enums/InventoryUnit.schema';
~~~~~~~~~~~~~~~~~~~
✖ Running plugin Zod
: Error compiling generated code
Environment (please complete the following information):
- ZenStack version: 1.0.0-beta.18
- Prisma version: 5.1.1
- Database type: Postgresql
Test setup
enum InventoryUnit {
DIGITAL // no limit but we can still track sales
FL_OZ
GRAMS
MILLILITERS
OUNCES
UNIT
UNLIMITED
}
model TwoEnumsOneModelTest {
id String @id @default(cuid())
inventoryUnit InventoryUnit @default(UNIT)
inputUnit InventoryUnit @default(UNIT)
}
ymc9
Metadata
Metadata
Assignees
Labels
No labels