Closed leonardosantosdev closed 1 month ago
Every time i call a Message method using chat.lastMessage, this error occurs: TypeError: Cannot read properties of undefined (reading 'pupPage')
TypeError: Cannot read properties of undefined (reading 'pupPage')
I tried Message.downloadMedia() and Message.getInfo(). both returned the same error.
async getInfo() { // whenever the function needs to access this.client.pupPage const info = await this.client.pupPage.evaluate(async (msgId) => { const msg = window.Store.Msg.get(msgId); if (!msg || !msg.id.fromMe) return null; return new Promise((resolve) => { setTimeout(async () => { resolve(await window.Store.getMsgInfo(msg.id)); }, (Date.now() - msg.t * 1000 < 1250) && Math.floor(Math.random() * (1200 - 1100 + 1)) + 1100 || 0); }); }, this.id._serialized); return info; }
But if i call any Message method after a chat.fetchMessages(), i have zero problems.
Is there something am i missing?
A regular and correct return of media contend and/or message info
const client = new Client({ authStrategy: new LocalAuth(), }); client.on("qr", (qr) => { qrcode.generate(qr, { small: true }); }); const chats = await client.getChats(); const messageInfo = await chats[0].lastMessage.getInfo();
No response
Chromium
Standard
Yes, I am using Multi Device
Windows 10 whatsapp-web.js v1.25.0
Is there an existing issue for this?
Describe the bug
Every time i call a Message method using chat.lastMessage, this error occurs:
TypeError: Cannot read properties of undefined (reading 'pupPage')
I tried Message.downloadMedia() and Message.getInfo(). both returned the same error.
But if i call any Message method after a chat.fetchMessages(), i have zero problems.
Is there something am i missing?
Expected behavior
A regular and correct return of media contend and/or message info
Steps to Reproduce the Bug or Issue
Relevant Code
No response
Browser Type
Chromium
WhatsApp Account Type
Standard
Does your WhatsApp account have multidevice enabled?
Yes, I am using Multi Device
Environment
Windows 10 whatsapp-web.js v1.25.0
Additional context
No response