Open tansukhcodoffer opened 5 years ago
it seems that something is wrong with: 1) client initialization or 2) file in form data or 3) error handling in our lib
can you provide more details on how you initialise client and does this file exist?
I've just tried it with the provided sample and it worked :)
Here is my code. Wherever i am trying to upload media then getting error which is attached image. Please look at your latest twilio-chat.min.js SDK.
var f = e.target.files[0]; if (f) { var r = new FileReader();
r.onload = function (e) { var contents = e.target.result; activeChannel.sendMessage({ contentType: f.type, media: contents, }).catch(function(e){ console.log(e.message); }); } r.readAsBinaryString(f); }
1) Client initialization is okay. I have checked it. 2) The role permission is also okay for channel members.
I have tried all code which is mentioned on documentation but still getting error.
Anyone got the solution for this issue?
`
`
Uncaught (in promise) TypeError: Cannot read property 'postFormData' of undefined at t. (twilio-chat.min.js:127)
at k (twilio-chat.min.js:204)
at Generator._invoke (twilio-chat.min.js:204)
at Generator.e.(anonymous function) [as next] (***twilio-chat/dist/twilio-chat.min.js:204:4546)
at twilio-chat.min.js:127
at new Promise ()
at new t (twilio-chat.min.js:145)
at p (twilio-chat.min.js:127)
at t.value (twilio-chat.min.js:127)
at t. (twilio-chat.min.js:127)
I am getting error shown above. Need help regarding this issue.