When running the following line during send media option
new window.Store.MediaCollection()
the following error occurs
Uncaught TypeError: Cannot read property 'chatParticipantCount' of undefined
at new t (app2.6028db482da470f704f8.js:2)
at
As a result send media does not work.
Please post a solution on this if someone has already encountered this.
When running the following line during send media option
new window.Store.MediaCollection()
the following error occurs
Uncaught TypeError: Cannot read property 'chatParticipantCount' of undefined
at new t (app2.6028db482da470f704f8.js:2)
at :1:1As a result send media does not work.
Please post a solution on this if someone has already encountered this.
Search for all occurrences of mediaCollection and replace:
var mc = new Store.MediaCollection();
to
var mc = new Store.MediaCollection(chat);
Perfect
solved
Thank you @nicolaubrasil
God bless you. Very thanks! @nicolaubrasil
God Bless You :))
@nicolaubrasil, i am also trying to create new group, but i get this error:
command:
WAPI.createGroup('roy1','{someNumberPhone}@c.us')
error:
app2.f48061877e9df2cd6e52.js:2 Uncaught TypeError: Cannot read property 'map' of undefined
at e (app2.f48061877e9df2cd6e52.js:2)
at Object.t.createGroup (app2.f48061877e9df2cd6e52.js:2)
at Object.window.WAPI.createGroup (
at
@roysG to create a new group you need to pass in an array in the second argument - like this WAPI.createGroup('roy1',['[email protected]'])
@fernand0aguilar, i also tried to pass it with array, without success, same error, you can also test it in your side
code:
WAPI.createGroup("group007" ,['[email protected]'])
result:
app2.f48061877e9df2cd6e52.js:2 Uncaught TypeError: Cannot read property 'map' of undefined
at e (app2.f48061877e9df2cd6e52.js:2)
at Object.t.createGroup (app2.f48061877e9df2cd6e52.js:2)
at Object.window.WAPI.createGroup (
at
I'm getting TypeError: window.Store.MediaCollection is not a constructor here now. Seems that MediaCollection has changed and now the autoDiscoverModules is unable to find it.
Was able to fix the issue by clearing all the data.
change this
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },
mc.processFiles([mediaBlob], chat, 1).then(() => {
var media = mc.models[0];
media.sendToChat(chat, { caption: caption });
if (done !== undefined) done(true);
});
to this
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },
if (Debug.VERSION === '0.4.613') {
mc.processAttachments([mediaBlob], chat, 1).then(() => {
var media = mc.models[0];
media.sendToChat(chat, {caption: caption});
if (done !== undefined) done(true);
});
} else {
mc.processAttachments([{file: mediaBlob}], chat, 1).then(() => {
var media = mc.models[0];
media.sendToChat(chat, {caption: caption});
if (done !== undefined) done(true);
});
}
This works! Thanks
Thanks a ton the above
change this
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null }, mc.processFiles([mediaBlob], chat, 1).then(() => { var media = mc.models[0]; media.sendToChat(chat, { caption: caption }); if (done !== undefined) done(true); });to this
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null }, if (Debug.VERSION === '0.4.613') { mc.processAttachments([mediaBlob], chat, 1).then(() => { var media = mc.models[0]; media.sendToChat(chat, {caption: caption}); if (done !== undefined) done(true); }); } else { mc.processAttachments([{file: mediaBlob}], chat, 1).then(() => { var media = mc.models[0]; media.sendToChat(chat, {caption: caption}); if (done !== undefined) done(true); }); }
this worked.....
var mc = new Store.MediaCollection();
and
var mc = new Store.MediaCollection(chat);
both not working
Most helpful comment
Search for all occurrences of mediaCollection and replace:
var mc = new Store.MediaCollection();to
var mc = new Store.MediaCollection(chat);