DanielD
Convex Communityβ€’9mo agoβ€’
6 replies
Daniel

Date is not a supported Convex type in v.any() field.

Hey Convex Team! πŸ‘‹πŸ½ πŸ‘‹πŸ½

We are trying to store the messages of an AI SDK chat in the following field:

messages: v.array(v.any())

When trying to insert the messages we get the following error:

Date "2025-05-13T12:03:51.916Z" is not a supported Convex type

An example of the input json is:

[
  {
    "role": "user",
    "content": "...",
    "id": "...",
    "createdAt": "2025-05-13T12:03:42.185Z",
    "parts": [
      {
        "type": "text",
        "text": "..."
      }
    ]
  },
  {
    "role": "assistant",
    "content": "...",
    "id": "...",
    "createdAt": "2025-05-13T12:03:51.916Z",
    "reasoning": "undefined",
    "toolInvocations": [],
    "parts": [
      {
        "type": "step-start"
      },
      {
        "type": "text",
        "text": "..."
      }
    ]
  }
]


Why does convex try to parse the string into a date object and not just use a string when I specify `v.any()?
Was this page helpful?