Basically in my error log i see lots of:
mysite.com/undefined (with referer coming from random pages of the website)
User-Agent: Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
(and some other user agent)
I have of course checked HTML or DOM for links with /undefined
or something like that and there is just nothing. I have checked network tab with developer tools and on those page nothing requests /undefined
(with my chrome).
I have then setted a javascript logger to save any error that come up. And in the log there isn't nothing that throws undefined or something like that...
This is driving me crazy. Of course if i go on tihs page with my chrome, javascript doesn't print any error
Notice: i have read everything here
Notice2: Beside that javascript error logger I have added an eventlistener (as explained in the answer linked)
$("body").on("click", "a[href$='undefined']", function() {
window.onerror('Bad link: ' + $(this).html()); //alert home base
});
And this never get triggered. (I have tested it with a manual /undefined link and the logger works)
Also I found this topic on google groups. Webmaster there are experiencing the same problem but no one has managed to nail down to the cause.
Maybe it's some extension on chrome or any other browser that causes this requests.
Sometimes, when an user has requested one page, several seconds later I see a similar request but the all string after the last / in the url has been replaced by "undefined". Example: http://example.com/foo/bar triggers a http://example.com/foo/undefined request.
You fix this by opening the listen step in your VSM file, and changing the base path in there, so you don't get a 404 error. You could change that to "/api/" so any api requests are dealt-with, or "/api/retrieveId/" so only retrieveId messages are dealt-with, or "/" so all requests are dealt-with.
The 404 error status code indicates that the REST API can't map the client's URI to a resource but may be available in the future. Subsequent requests by the client are permissible. No indication is given of whether the condition is temporary or permanent.
That said, the appearance of a HTTP 404 error doesn't always mean the issue is client-related (web browser or device used to access the application). Sometimes, the root of the problem is server-side. Remember, the server is still the network object producing the 404 Not Found Error.
Presumably you are using window.onerror
and logging an error in that function.
If a javascript error happens on a different domain (e.g. from some social buttons, an iframe, a cross-domain javascript, or possibly a browser extension), window.onerror could actually betray sensitive information in the error report. So for security reasons, cross-domain errors will still call the function, but all the parameters (including the url) will be undefined, and the message will just be a generic "Script error." I would guess you are having cross domain errors, and they're being logged as undefined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With