Issue Description
Calling client.getContacts() fails with an uncaught error: asUserWidOrThrow: wid is not a user wid. This seems to happen when the contact list contains non-user WIDs (like group JIDs) or new Linked ID (@lid) identifiers that the internal WhatsApp asUserWidOrThrow function does not validate as standard users.
Reproduction Steps
- Initialize the client and wait for the ready event.
- Call await client.getContacts().
- The process crashes with the following stack trace:
Error: asUserWidOrThrow: wid is not a user wid
at s (hqMvLvPUOL4.js:79:180)
at Object.I [as asUserWidOrThrow] (6ZCeJrDqvpN7oo8EPfVEEipN3BCR3yxG_Wl_HC4ZDPfu.js:910:3080)
at window.WWebJS.getContactModel (pptr:evaluate;executeReadyLogic (Client.js:417:36):1030:26)
at window.WWebJS.getContacts (pptr:evaluate;executeReadyLogic (Client.js:417:36):1082:22)
Code Sample
const contacts = await client.getContacts();
console.log(contacts);
User Setup
| WhatsApp |
Type |
| Account Type |
WhatsApp Business |
| Authentication Strategy |
LocalAuth |
| WhatsApp Web Version |
2.3000.1037376462 |
| whatsapp-web.js Version |
1.34.6 |
| Environment |
Version |
| Browser Type |
Google Chrome |
| Browser Version |
146.0.7680.76 (Compilación oficial) (64 bits) |
| Phone OS Version |
Android 12 |
| Running OS Version |
Windows / Ubuntu 24 |
| Node.js Version |
v22.14.0 |
Checklist
Issue Description
Calling
client.getContacts()fails with an uncaught error:asUserWidOrThrow: wid is not a user wid. This seems to happen when the contact list contains non-user WIDs (like group JIDs) or new Linked ID (@lid) identifiers that the internal WhatsAppasUserWidOrThrowfunction does not validate as standard users.Reproduction Steps
Code Sample
User Setup
Checklist