Skip to content

Cannot download media from @lid (WhatsApp Business) contacts: TypeError: Cannot read properties of undefined (reading 'split') #201856

Description

@jdrrsystem

Issue Description

Cannot download media from WhatsApp Business accounts (@lid). Calling message.downloadMedia() throws TypeError: Cannot read properties of undefined (reading 'split') internally inside downloadBuffer (or similar inner functions). Regular @c.us media works perfectly, only @lid media fails.

Reproduction Steps

  1. Receive an image, video or audio from a WhatsApp Business account (@lid contact).
  2. Call await message.downloadMedia() on that message.
  3. Observe the Cannot read properties of undefined (reading 'split') error being thrown inside wwebjs.

Code Sample

client.on('message', async (message) => {
    if (message.hasMedia && message.from.includes('@lid')) {
        try {
            const media = await message.downloadMedia();
        } catch (err) {
            console.error(err); // Throws the 'split' error
        }
    }
});

User Setup

WhatsApp Type
Account Type Standard
Authentication Strategy LocalAuth
WhatsApp Web Version 2.3000.1017054665
whatsapp-web.js Version github:pedroslopez/whatsapp-web.js#webpack-exodus
Environment Version
Browser Type Chromium (Puppeteer)
Browser Version 120.0.6099.71
Phone OS Version Android / iOS
Running OS Version Ubuntu 24 (Docker)
Node.js Version v20.x

Checklist

  • I use the latest released version of whatsapp-web.js.
  • I have searched existing issues and confirmed this is not a duplicate.
  • I have verified this is a library issue, not a problem with my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenbuildBuild systemissued highHigh impact issuetypingsType definitions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions