whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

TypeError: Cannot read properties of undefined (reading 'createWid')

Open Murilandrade opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

I use the injected.js from a chrome extension and when i use this code:

const newMessage = async (chatId, message) => { const chatWid = window.Store.WidFactory.createWid(chatId); const chat = await window.Store.Chat.find(chatWid); const msg = await window.WWebJS.sendMessage(chat, message);

return msg.serialize();

}

newMessage("[email protected]", "hi, how are you?");

is not working

Expected behavior

Yestarday the code was sending messages and today is not working

Steps to Reproduce the Bug or Issue

inject the file injected.js on whatsapp web and than, run the code on terminal

Relevant Code

No response

Browser Type

Google Chrome

WhatsApp Account Type

WhatsApp Business

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

windows 11 Whatsapp Web version: latest version

Additional context

No response

Murilandrade avatar Oct 29 '22 21:10 Murilandrade

faced same problem today

dsaha1656 avatar Oct 31 '22 09:10 dsaha1656

Similar problem here: cannot convert wid to ChatJid

luiscuriel avatar Oct 31 '22 14:10 luiscuriel

I have the same problem ..

sautpt avatar Nov 01 '22 07:11 sautpt

Same problem now

sciapuscio avatar Nov 01 '22 16:11 sciapuscio

no solution yet to "cannot convert wid to ChatJid"?

luiscuriel avatar Dec 03 '22 18:12 luiscuriel

Wrong user id is passed, check example.js

alechkos avatar Dec 04 '23 22:12 alechkos