Skip to content

Can't infer types from Object.fromEntries correctly #1120

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

Closed
Hekikai opened this issue Mar 28, 2025 · 2 comments
Closed

Can't infer types from Object.fromEntries correctly #1120

Hekikai opened this issue Mar 28, 2025 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Hekikai
Copy link

Hekikai commented Mar 28, 2025

Issue

When i try to create schema dynamically, i get the TS Error - argument of type is not assignable to parameter of type ObjectEntries string index signatures are incompatible. I cannot figure out how to type it correctly (row 55 - it is the point)

Playground

Link

@Hekikai Hekikai changed the title Can't infer types from Object.fromEntries correctly Can't infer types from Object.fromEntries correctly Mar 28, 2025
@fabian-hiller
Copy link
Owner

Here is the fix. You forgot to wrap the email action with a pipe of the string schema.

@fabian-hiller fabian-hiller self-assigned this Mar 29, 2025
@fabian-hiller fabian-hiller added the question Further information is requested label Mar 29, 2025
@Hekikai
Copy link
Author

Hekikai commented Mar 29, 2025

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants