Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raygun4js hijacking console.log stack trace in developer tools, even when not enabled. #348

Open
JLongley opened this issue Feb 13, 2020 · 9 comments

Comments

@JLongley
Copy link

JLongley commented Feb 13, 2020

We use raygun for error logging in production, but want to have it disabled in development mode.
After importing the module into our react project, it makes debugging locally with console.log quite difficult because it overwrites the stack trace of the original message with one that just points down into the internals of the module.

e.g.:

    console.log('Before importing raygun')
    import('raygun4js').then(module => {
        console.log('After importing raygun')
    })

In the console:

Before importing raygun     index.js:40
After importing raygun      raygun.umd.js:1774

Is there any way to disable this behavior?

@BenjaminHarding
Copy link
Contributor

Thanks for raising the issue @JLongley. Sadly there isn't a way to currently disable this behaviour.

We can look at fix this behaviour in a future release but I can't give a estimate as to when that would be :)

@criticalserenity
Copy link

I found a temporary solution. You can add raygun.umd.js script to chrome dev tools blackbox, so any logs to console will ignore raygun wrapper.

Screen Shot 2020-02-17 at 19 10 14

@hipitihop
Copy link

hipitihop commented Apr 26, 2022

We have recently upgraded our Raygun dependency from "2.2.5" to "2.25.1" and discovered the same issue. In our case it is causing delays of up to 40 seconds in our development environment. @BenjaminHarding can you please provide an update on the status of this issue. Can you also please provide suggested JS code to workaround this in the meantime. i.e. what is the recommended way to revert default behavior

In the meantime we have tested various version and decided to stay on 2.5.3 which does not have the console.log hijack

@CmdrKeen
Copy link
Contributor

Hi @hipitihop - Ben Harding isn't with Raygun these days, but I'll bring in one of the team to pick this up!

@hipitihop
Copy link

@CmdrKeen Thanks. I like to also note that this console hijack also tends to obfuscate the devtools/console log source. It links to this hijack, instead of the true source generating the log entry.

@Widdershin
Copy link
Contributor

Hi @hipitihop,

The console wrapper can be disabled by calling rg4js('disableAutoBreadcrumbsConsole'), which will restore the unwrapped console functions.

In our case it is causing delays of up to 40 seconds in our development environment.

This is concerning, and definitely shouldn't be occurring. I'd be interested to know if still happens when using disableAutoBreadcrumbsConsole, since that might be another issue entirely.

@hipitihop
Copy link

@Widdershin Thanks for the prompt response. With 2.25.3 that fn disableAutoBreadcrumbsConsole is not available. I tried disableAutoBreadcrumbs instead. Indeed this seems to have removed the wrapper and sorted our performance issue. The Tracking XHR wrapper seems to remain, but we are not aware of any issues with this at this point. Let me know if you need more details.

@Widdershin
Copy link
Contributor

@hipitihop glad that sorted it out. We're planning to disable console breadcrumbs by default in a future release.

I'll open a separate issue to track that performance problem, definitely sounds like something we should get to the bottom of. What sort of delays did you experience? Full page freezes or delays in sending exceptions?

I think the XHR wrapper not disabling is a known issue, but I'll try to get that resolved for the next release in any case.

@hipitihop
Copy link

@Widdershin

  1. The performance issue: For developers (not production builds), we use re-frame-10x. When the console.log is hijacked by Raygun4JS, we would experience delays of up to 40 seconds in this tool. In turn, this would also effect our main apps-ui rendering. We did not notice delays related to sending exceptions.
  2. As for the XHR wrapper not disabling, as mentioned, this alone does not cause any issues at our end at this point. However, perhaps both the console and the XHR should be independently controllable, perhaps even via your options arg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants