Skip to content
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

[Tooling] Genkit UI Freezes When Using .min(1) on z.string() in Flow Input Schema #1941

Open
mike-4040 opened this issue Feb 12, 2025 · 1 comment
Labels
bug Something isn't working tooling

Comments

@mike-4040
Copy link

Describe the bug

When adding .min(1) to a string property in the flow input schema, like this:

When I add .min(1) to string property of flow input schema, like

const InputSchema = z.object({
  message: z.string().min(1),
});

and passing it to ai.defineFlow(), the flow itself functions correctly, and validation works.

However, the Genkit UI freezes completely as soon as you select the flow.
Reloading the page, restarting the UI, or modifying the schema does not resolve the issue.

Interestingly, other validation methods such as z.string().email() do not cause any problems.

To Reproduce

  1. Start Genkit with the UI enabled.
  2. Open any existing flow in the UI and ensure it runs correctly.
  3. Modify the input schema by adding .min(1) to an existing z.string() property or introducing a new z.string().min(1) property.
  4. Try to run the flow.
  5. The Genkit UI will freeze immediately upon selecting the flow.

Expected Behavior

  • All documented Zod methods should be supported.
  • If certain methods are not supported, this should be documented clearly.
  • The UI should handle schema validation errors gracefully instead of freezing.

System Information

  • OS: macOS Sequoia 15.3 (24D60)
  • Browser: Chrome 133.0.6943.54 (Official Build) (arm64)
@mike-4040 mike-4040 added bug Something isn't working tooling labels Feb 12, 2025
@mike-4040
Copy link
Author

cc: @trevor-rex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tooling
Projects
Status: No status
Development

No branches or pull requests

1 participant