"string.email>0" custom message not working
Hey for most types i use .configure({message: "Some error message"}) to customize error messages for fields.
When i use it on email type it seems configure does not work the same:
What should I do to get a custom message in this case?
3 Replies
configure
only works with scopes:
Thanks for the response. that code seems a bit complex just to overwrite the validation message no?
@Claus @GreggOD
configure
does work outside scopes, but there is an issue specifically for customizing errors like this one that include multiple parts.
Here's the relevant GitHub issue:
https://github.com/arktypeio/arktype/issues/1412
The workaround would be to use a global or scope config to avoid this behavior for now as mentioned in the GitHub issue.
We'll work on fixing this ASAP so the workaround isn't required!GitHub
Unable to directly configure top-level intersection error message ...
import { type } from "arktype"; const Thing = type("string.email > 0").configure({ message: "Email is not valid", }); // standard bulleted message- config seemingly...