Continuous increasing type error


Continuous increasing type error


Uncaught TypeError: event.data.indexOf is not a function
at receiveMessage (out.js:4)



Note: I dont have anything like out.js in my project structure.


out.js



Hi Everyone, I know this looks common issue but believe me this issue came even when I started the project from the scratch. I am currently doing a react project. Even when I was doing project in Angular this issue was always there.



I am using Chrome Browser.



What is this type of issue all about? When I use React dev tools this error keep on increasing in number.



I am unable to figure it out. Please donot mark it as duplicate. I really need a solution.



This is what I got when I click that out.js in browser


window.addEventListener("message", receiveMessage, false);

function receiveMessage(event) {
if (event.data.indexOf("skypetoken") > -1) {
var t = event.data;
var skype_token = t.toString().substring(t.toString().lastIndexOf('skypetoken":"') + 13, t.toString().indexOf('","expires_in"'));
var skypeid = t.toString().substring(t.toString().lastIndexOf('skypeid":"') + 10, t.toString().indexOf('","state"'));
console.log(skype_token, skypeid);
chrome.storage.sync.set({"skype_token":skype_token ,"skypeid" : skypeid}, function () {
});
}
}



--------------------------------SOLVED-------------------------------



But I dont Know why some chrome extension was showing me this error.





Maybe show us your code? Context? Anything?
– Chris R
Jul 2 at 13:32





event.data is probably not an array, so it lacks indexOf metgod. You need to provide more information if you want a useful answer.
– riv
Jul 2 at 13:33


event.data


indexOf





"this looks common issue", well this error message is well known, and by looking at it, I guess event.data is undefined (or at least not an iterable object)
– Seblor
Jul 2 at 13:34


event.data





give me a minute i am posting the code
– Shubham Agarwal Bhewanewala
Jul 2 at 13:37





you can check it.
– Shubham Agarwal Bhewanewala
Jul 2 at 13:41









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?