Sentry-react-native: Console logs are generated from instrument.js file

Created on 12 Mar 2020  路  10Comments  路  Source: getsentry/sentry-react-native

OS:

  • MacOS

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native

SDK version: 1.2.0
react-native version: 0.59.10

Are you using Expo?

  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)

I have following issue:

In my system, while debugging on Chrome , all my logs are coming from a file named instrument.js
which is placed at /node_modules/@sentry/utils/dist/instrument.js at line 104
But I want my logs to show the line from where log is originated.

Let me know if there is any possible configuration that I am missing.

Most helpful comment

This solution is not working. Tried restarting Chrome after adding the blackbox, it didn't help

Try adding instrument.ts to the Blackbox. It just worked for me

image

All 10 comments

Tried above fix, didn't work, I had to comment the line in instrument.js file from which all the logs were generated.

please re-open this issue, i have the same problem all console logs shows instrument.js 112
Captura de Pantalla 2020-03-17 a la(s) 12 34 12

In instrument.js file,
do the following changes in the function containing this line points to :

function instrumentConsole() {
    if (('console' in global)) {
        return;
    }

}

Hence, if there is a console module defined globally, it will return, we just have to reverse the condition. However, this change needs to be reverted in production build or hence console logs might not get sent.

None of the above are valid solutions.. can this please be re-opened?

OK sorry if I wasn't clear enough, adding /ravenjs/ is wrong you need to add /@sentry/ then it works just fine.

Before:
image

After:
image

Add this to your Chrome Blackbox settings:
image

This solution is not working. Tried restarting Chrome after adding the blackbox, it didn't help

This solution is not working. Tried restarting Chrome after adding the blackbox, it didn't help

Try adding instrument.ts to the Blackbox. It just worked for me

image

Ignoring script in Firefox does not change the behavior. This issue makes debugging useless since the console.log stack is completely gone.

Be sure to add both instrument.ts and /@sentry/ to Blackboxing.

Was this page helpful?
0 / 5 - 0 ratings