-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Is there an existing issue for this?
- I have searched the existing issues.
Is this a problem caused by your code, or is it specifically because of the library?
- I have double-checked my code carefully.
Describe the bug.
Error sending message: Error: Attempted to use detached Frame '001CC3B2E7A60BE758B628A1B0ECFD52'. at CdpFrame.<anonymous> (E:\WhatsAppNode\TexWAApi\node_modules\puppeteer-core\src\util\decorators.ts:61:15) at CdpPage.evaluate (E:\WhatsAppNode\TexWAApi\node_modules\puppeteer-core\src\api\Page.ts:2341:35) at Client.sendMessage (E:\WhatsAppNode\TexWAApi\node_modules\whatsapp-web.js\src\Client.js:1076:44) at E:\WhatsAppNode\TexWAApi\src\index.ts:110:10 at Layer.handle [as handle_request] (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\layer.js:95:5) at next (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\route.js:149:13) at multerMiddleware (E:\WhatsAppNode\TexWAApi\node_modules\multer\lib\make-middleware.js:13:41) at Layer.handle [as handle_request] (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\layer.js:95:5) at next (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\route.js:149:13) at Route.dispatch (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\route.js:119:3) at Layer.handle [as handle_request] (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\layer.js:95:5) at E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\index.js:284:15 at router.process_params (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\index.js:346:12) at next (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\index.js:280:10) at urlencodedParser (E:\WhatsAppNode\TexWAApi\node_modules\body-parser\lib\types\urlencoded.js:82:7) at Layer.handle [as handle_request] (E:\WhatsAppNode\TexWAApi\node_modules\express\lib\router\layer.js:95:5)
Error stack is thrown, when calling the sendMessage with a file path to chromium browser
Expected Behavior
on this method a message with file should be sent
Steps to Reproduce the Bug or Issue
try {
if (file) {
const media = MessageMedia.fromFilePath(file);
const caption: string = media.filename ?? "";
const message = await client
.sendMessage(chatId, content, { media, caption: caption })
.catch((err) => {
console.log("Error sending message:", err);
});
return res.sendStatus(message ? 200 : 400);
} else {
const message = await client.sendMessage(chatId, content).catch((err) => {
console.log("Error sending message:", err);
});
return res.sendStatus(message ? 200 : 400);
}
} catch (error1) {
return res.send("File Not found");
}WhatsApp Account Type
Standard
Browser Type
chromium
Operation System Type
Windows
Phone OS Type
Android
WhatsApp-Web.js Version
1.34.4
WhatsApp Web Version
1.38.0
Node.js Version
18
Authentication Strategy
LocalAuth
Additional Context
No response