Skip to main content
This error occurs when message objects donโ€™t conform to the expected format. TODO: Add JS example

Troubleshooting

To resolve this error:
  1. Ensure proper format: All inputs to chat models must be an array of LangChain message classes or a supported message-like format
  2. Verify no unintended stringification or transformation occurs to your messages
  3. Examine the errorโ€™s stack trace and add logging statements to inspect message objects before theyโ€™re passed to the model

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.