-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Importing infer
type makes all props unknown
?
#3536
Comments
I have a very similar issue with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm having an issue where I have one package to define Zod schemas and types, and I import those types in other packages. The issue I'm having is that the exported
type
drops all property types and makes them unknown.Importing the type where is its needed results in all property types being wiped away:
If I take the exact same Zod schema and type and declare them in the package where I am importing them, the type information is persisted. I feel like this is something to do more with TS typings than Zod, but I've hit a wall with how to move forward.
edit
It appears my issue is due to using a an
enum
type withinz.literal
. Changing this to a regular string fixes type-inference, but then I lose the ability to reference my source enum for the value. This is further complicated because I'm using these types as part of a discriminatedUnion, with the enum values being used as the discriminator.The text was updated successfully, but these errors were encountered: