Skip to content

undefined messages in the body when attaching files larger than ~1 MB in v5 #7294

@nikitatome

Description

@nikitatome

Description

I'm trying to attach images using sendMessage({ text, files }) where files is a FileList. This works fine when images are relatively small, but if they are full size screenshots (larger than approximately 1 MB) then I see a TypeError: Cannot destructure property 'messages' of 'req.body' as it is undefined. error in my backend. Do we need to somehow await until we've fully received the messages object?

const router = express.Router({});

router.post('/chat/:threadId', (async (req, res) => {
  const { messages, modelName } = req.body;
}

I don't have this issue with https://ai-sdk-preview-attachments.vercel.app/ only my local v5

AI SDK Version

  • ai: 5.0.0-beta.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy