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
- Receive an image, video or audio from a WhatsApp Business account (
@lid contact).
- Call
await message.downloadMedia() on that message.
- 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
Issue Description
Cannot download media from WhatsApp Business accounts (
@lid). Callingmessage.downloadMedia()throwsTypeError: Cannot read properties of undefined (reading 'split')internally insidedownloadBuffer(or similar inner functions). Regular@c.usmedia works perfectly, only@lidmedia fails.Reproduction Steps
@lidcontact).await message.downloadMedia()on that message.Cannot read properties of undefined (reading 'split')error being thrown inside wwebjs.Code Sample
User Setup
Checklist