Raygun JS error
sbozzie
Posted on
Jun 06 2014
Hi guys,
We've recently set up Javascript tracking, but raygun seems to hit an error when on our basket page (eCommerce application)
The script is being loaded like so:
<script type="text/javascript" src="/js/raygun.min.js"></script>
<script type="text/javascript">
Raygun.init('APIKEYHERE');
</script>
And the error we see in chrome console (using the non-minified raygun for clarity) is as follows:
Thanks,
Sam
Callum
Posted on
Jun 09 2014
Hi,
Could you please provide a list of any other external libraries or scripts which may be adding onerror handlers, if any? Also it may be useful if you load your page then call window.onerror in the console, then paste the output here.
Regards,
Callum Gavin
Mindscape Limited
sbozzie
Posted on
Jun 09 2014
window.onerror returns:
function (n,e,t,o,a){var u=null;if(a)u=r.computeStackTrace(a);else if(s)r.computeStackTrace.augmentStackTraceWithInitialElement(s,e,t,n),u=s,s=null,l=null;else{var c={url:e,line:t,column:o};c.func=r.computeStackTrace.guessFunctionName(c.url,c.line),c.context=r.computeStackTrace.gatherContext(c.url,c.line),u={mode:"onerror",message:n,url:document.location.href,stack:[c],useragent:navigator.userAgent}}return i(u,"from window.onerror"),f?f.apply(this,arguments):!1}
The page is using:
jQuery UI 1.7.2 jQuery 1.10.1 Some custom checkout js
Nothing that should be adding any onerror handlers that I'm aware of though.
Thanks,
Sam
Callum
Posted on
Jun 13 2014
Hm, that looks correct - I have created a branch with a candidate fix for this condition, if you could grab it from https://raw.githubusercontent.com/MindscapeHQ/raygun4js/undefined-function-guard/dist/raygun.js and let me know if it fixes the problem. If it does I will get it merged+deployed as a new version.
Regards,
Callum Gavin
Mindscape Limited