I did client-side exception logging with window.onerror , where I retrieve the current error and stack trace and send it to the server using AJAX
window.onerror = function(message, url, line) { var stackTrace = printStackTrace();
where printStackTrace is the function provided by this library: http://stacktracejs.com/
The problem is that all JavaScript files are reduced in production, so the stack trace and line number are not very useful, because all error messages are reported on line 1 in the file, which is normal, since the miniature version contains one line of code. For instance:
Message: Object doesn't support property or method 'indexOf' URL: http://[server]/[site]/content/combined/combined.635EE367354E6DF721593CAC56FECF95.min.js Line: 1
Can this be improved using source maps, or does it only work when the developer tools are active?
I would like to get a full stack trace using the source maps (or at least the real line number) when an error occurs for a user who does not have activated / activated developer maps. Is this even possible?
source share