Better javascript stack trace

timbailey99

Posted on
Dec 15 2015

What would be a best practice for making this stack trace usable? We are using V2 api just attaching to the onerror handler ie

rg4js('apiKey', 'keygoeshere');
rg4js('attach', true);

The error is self explanatory but how to find the actual code causing the issue?

Message: Unable to get property 'length' of undefined or null reference
         at b line 5, column 245 (https://cdn.raygun.io/raygun4js/2.2.0-beta/raygun.min.js:5)
         at f.resolveWith line 16, column 14201 (https://testsite/fe/scripts/jquery-1.5.2.min-59444.js:16)
         at v line 16, column 68298 (https://testsite/fe/scripts/jquery-1.5.2.min-59444.js:16)
         at c line 16, column 73933 (https://testsite/fe/scripts/jquery-1.5.2.min-59444.js:16)

--

Thanks Tim


Alex

Posted on
Dec 18 2015

Hi Tim,

It looks like this stacktrace is occurring on minified code. If you can make source maps available to our service we can map them onto the original source code lines.

You can read about how to do this here: https://raygun.io/docs/workflow/source-maps

Using minified files with source maps is generally only necessary for production environments so I'd also have a look at deploying unminified code to your development/test environments to avoid having to set up multiple sets of source maps for all your environments.

Hope that helps.

Best regards,
Alex


Reply