Software Archive
Read-only legacy content
17061 Discussions

How to get rid of console errors

David_K_6
Beginner
356 Views

I regularly receive the following error in my app:

Uncaught TypeError: Cannot read property 'call' of undefined target-script-min.js:1283

This seems to be benign, but it would be nice to get rid of it, Any ideas?

It goes away if I remove the weinre script, of course.

 

(Apologies if anyone saw the earlier version of this post, which had some spurious stuff on it)

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
356 Views

I assume you are not keeping the weinre script in your app when you publish it? That's not a good idea, it should be removed from your app before you publish your app.

Are you getting this when using the Emulate tab? If so, it can be ignored.

0 Kudos
David_K_6
Beginner
356 Views

I've been sane enough to remove it from most of the beta test builds (although I have been forgetting some, which is embarrassing). 

I do have a zero-tolerance approach to console errors, though, so I don't really like the idea of "just ignoring it". So I guess that since I don't use the weinre debugger often (I either debug on the emulator, or use trace statements on a real machine), I'll just leave the script out most of the time unless needed.

Having said which, it wouldn't be a difficult thing for your developers to fix: all it needs is to make the following change to line 1283, from

return xhr.httpSocketHandler.call(xhr.httpSocket, xhr);

to

if (xhr.hasOwnProperty('httpSocketHandler')) {
    return xhr.httpSocketHandler.call(xhr.httpSocket, xhr);
}

If you can alert developers of this, that would be nice...

0 Kudos
Reply