Sentry (raven-js) obfuscates my console line numbers

I’m using React create-react-app. I’m using raven-js. When I import Raven from 'raven-js and Raven.config('https://mysentryurl').install(), I get this:

https://cdn-std.dprcdn.net/files/acc_537232/KKbP6z

Without it, I get the actual line number where the console.log occurred (e.g., App.js:15).

This is a pretty big disincentive to using the service. I was able to find a workaround by using dotenv, which bundles with create-react-app, and wrapping my Raven invocation as follows:

if (process.env.NODE_ENV !== 'development') { let Raven = require('raven-js'); Raven.config('myurl').install() }

Do I need to check my environment anytime I make a call to Raven?

Hey @andrewh, you can disable autoBreadcrumbs for console logs in the config.

Please see https://docs.sentry.io/clients/javascript/config/ autoBreadcrumbs section for a reference.

tl;dr:

autoBreadcrumbs: {
    'console': false
}
1 Like