-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Memory leak with email validation in zod forms #46
Comments
Wow, this is definitely a weird one, especially considering it only occurs when validating the email constraint 🤔. Does this happen when using Superforms by itself, or only when using it with Formsnap? If it was happening for all the validation cases then it would make more sense, but the fact that it's only happening for this one is peculiar. |
There's this issue here that might be related: colinhacks/zod#2580 |
Going to close this as it isn't an issue with Formsnap itself, but rather an issue with Zod and complex email addresses. As a solution in the meantime, you can stop using const schema = z.object({
email: z.regex(/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/)
}) |
Thank you so much! So weird that this is yet to be actionable by |
Current Behavior
The browser tab hangs and crashes
Expected Behavior
Email validation works
Steps To Reproduce
Link to Reproduction / Stackblitz
https://stackblitz.com/edit/github-zxmrcw?file=src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2F%2Blayout.svelte
More Information
I did some testing and this only happens when validating the email constraint -> and I have no running hypothesis why is that the case.
The text was updated successfully, but these errors were encountered: