View detailed error logs in the browser

Problem

You want to use your browser's console to view detailed error messages environment, but when New Relic Browser is active, your browser's console does not display detailed error traces.

Solution

New Relic Browser must capture and re-throw errors in order to record them, but some browser versions do not display stack traces for re-thrown errors. To solve this problem, eEnable New Relic Browser's development mode in your local browser.

New Relic Browser agent versions 593 or higher include a workaround for this behavior, which can be enabled in the console. The following procedure is for Google Chrome, but you can adapt it for other browsers.

  1. In Chrome, select the menu icon, then select More tools > JavaScript Console.
  2. From the JavaScript console, set the following value for nr_flags in local storage:

    localStorage.setItem('__nr_flags', 'dev')
  3. Refresh the page where you want to see your JavaScript errors.

  4. To confirm development mode is active, check the console's Browser agent logs for the message NR AGENT IN DEVELOPMENT MODE.

  5. Navigate the site, then trigger the errors that you want to track.

To disable development mode, run the following command in the console:

localStorage.removeItem('__nr_flags')

For more help

Recommendations for learning more: