Issue Description
Facing issue when calling fetchMessages
Error [TypeError]: Cannot read properties of undefined (reading 'waitForChatLoading')
Object. (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2085:1607)
Generator.next ()
at evaluate (evaluate at PrivateChat.fetchMessages (/app/node_modules/whatsapp-web.js/src/structures/Chat.js:193:50), :16:79)
at #evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)
at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)
at async IsolatedWorld.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)
at async CdpFrame.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:362:20)
at async CdpPage.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:818:20)
at async PrivateChat.fetchMessages (/app/node_modules/whatsapp-web.js/src/structures/Chat.js:193:24)
at async /app/server.js:472:35
at y (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2084:1394)
at (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:276)
at (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:407)
at i (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:348)
at l (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:124)
at (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2084:1606)
Reproduction Steps
- Scan QR
- After successful scan, fetch chatIds via getChats()
- For given chatid,
const chat = await client.getChatById(chatId);
await chat.sendSeen(); // working fine till here
const msgs = await chat.fetchMessages({ limit: 50 });
Code Sample
User Setup
| WhatsApp |
Type |
| Account Type |
Standard |
| Authentication Strategy |
LocalAuth |
| WhatsApp Web Version |
2.2412.54 |
| whatsapp-web.js Version |
1.34.6 |
| Environment |
Version |
| Browser Type |
Chromium |
| Browser Version |
Headless |
| Phone OS Version |
Android |
| Running OS Version |
Windows |
| Node.js Version |
18.0.0 |
Checklist
Issue Description
Facing issue when calling fetchMessages
Error [TypeError]: Cannot read properties of undefined (reading 'waitForChatLoading')
Object. (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2085:1607)
Generator.next ()
at evaluate (evaluate at PrivateChat.fetchMessages (/app/node_modules/whatsapp-web.js/src/structures/Chat.js:193:50), :16:79)
at #evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:391:56)
at async ExecutionContext.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:277:16)
at async IsolatedWorld.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:16)
at async CdpFrame.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:362:20)
at async CdpPage.evaluate (/app/node_modules/whatsapp-web.js/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:818:20)
at async PrivateChat.fetchMessages (/app/node_modules/whatsapp-web.js/src/structures/Chat.js:193:24)
at async /app/server.js:472:35
at y (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2084:1394)
at (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:276)
at (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:407)
at i (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:348)
at l (https://static.whatsapp.net/rsrc.php/v4/y8/r/cqQl5CN3vO-.js:108:124)
at (https://static.whatsapp.net/rsrc.php/v4iu4R4/yX/l/en_GB-j/Ynaf25JJq1v.js:2084:1606)
Reproduction Steps
const chat = await client.getChatById(chatId);
await chat.sendSeen(); // working fine till here
const msgs = await chat.fetchMessages({ limit: 50 });
Code Sample
User Setup
Checklist