arktypea
arktype5mo ago
TheGuy

Custom message not working

Hi there,

For whatever reason when going off creating a custom message when doing:

export const productBase = type({
  name: type.string.configure({
    message: (ctx) => `Product name is required.`,
  })
});


I am not seeing the above message and instead getting the default name must be a string (was missing)

What is going wrong here?

When drilling into the schema:

{
  "domain": "string",
  "meta": {
    "message": "$ark.message"
  }
}


I would of expected this to be different. I have also tried just having message as a string and not a function.
Was this page helpful?