Issue Description
Client.sendMessage works, message sent but the function returns undefined
i even tested it with minimal code on fresh new node project
other thing i recall is i recently try to delete C:\Users\User\.cache while the whatsapp client is running, and i get a warning from windows that files inside it is in use, turns out it contains the chrome used by puppeteer.
but i stopped the whatsapp client, deleted the .cache folder and reinstalled it, but i dont know if thats the cause.
Reproduction Steps
- call await Client.sendMessage()
- log the value returned by sendMessage
- it should be undefined
Code Sample
// minimal code tested on new project
...
import pkg from 'whatsapp-web.js';
const { Client, LocalAuth, MessageMedia, Buttons } = pkg;
...
// --- WA Client ---
const waClient = new Client({
puppeteer: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
},
authStrategy: new LocalAuth({ dataPath: path.join(DATA_DIR, "sessions") }),
});
...
waClient.on('ready', async () => {
console.log('WA client is READY');
const sent = await waClient.sendMessage("*************@c.us", "Client ready"); // <--- here, 'sent' is undefined
console.log('client ready message:', sent);
});
waClient.on("message_create", async (msg) => {
console.log('Received', msg);
});
waClient.initialize();
User Setup
| WhatsApp |
Type |
| Account Type |
Standard |
| Authentication Strategy |
LocalAuth |
| WhatsApp Web Version |
2.3000.1043612726 |
| whatsapp-web.js Version |
1.34.7 |
| Environment |
Version |
| Browser Type |
chrome |
| Browser Version |
win64-146.0.7680.31 |
| Phone OS Version |
android 10 |
| Running OS Version |
Windows 10 |
| Node.js Version |
22.19.0 |
Checklist
Issue Description
Client.sendMessage works, message sent but the function returns
undefinedi even tested it with minimal code on fresh new node project
other thing i recall is i recently try to delete
C:\Users\User\.cachewhile the whatsapp client is running, and i get a warning from windows that files inside it is in use, turns out it contains the chrome used by puppeteer.but i stopped the whatsapp client, deleted the .cache folder and reinstalled it, but i dont know if thats the cause.
Reproduction Steps
Code Sample
User Setup
Checklist