question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable sentry on dev environment when using angular plugin

See original GitHub issue

At the moment it is not possible to disable the sentry plugin because the ngRaven module fails to load.

On the development environment I use the following without providing the DSN Raven.config().install()

The callback that registers the raven provider is not called

Raven.addPlugin(function () {
    angular.module('ngRaven', [])
        .provider('Raven',  RavenProvider)
        .config(['$provide', ExceptionHandlerProvider]);
});

Because the install function does not call the plugin that installs the module isSetup() failed because the globalServer is null

install: function() {
    if (isSetup() && !isRavenInstalled) {
        TraceKit.report.subscribe(handleStackInfo);

        // Install all of the plugins
        each(plugins, function(_, plugin) {
            plugin();
        });

        isRavenInstalled = true;
    }

    return Raven;
},

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

26reactions
nblasgencommented, Jul 28, 2016

I had a similar request from @benvinegar and he pointed out that you can use:

Raven.config('your dsn', {
  shouldSendCallback: function () {
    return false;
  }
}).install();

And that will stop Raven from reporting. Switch the return status to TRUE and it will start reporting. At least this is what I’ve been told. We plan to use this plus a deployment sed command to flip the boolean at deployment time.

5reactions
paragjnathcommented, Oct 30, 2017

I have used this way. It seems working for me

`if (environment.production) { Raven.config(‘https://<key>@sentry.io/<project>’) .install(); }

and in providers providers: [environment.production ? { provide: ErrorHandler, useClass: RavenErrorHandler } : [], …`

Please let me know if I am doing anything wrong here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Sentry in Angular application at runtime - SDKs
The thing I'm looking for is to disable Sentry after it has been initialised … Sentry. getCurrentHub(). getClient().
Read more >
Angular with Sentry — A Step-by-Step Guide - Medium
In this article, we will see how to integrate Sentry in our Angular application to track errors. Let's start then.
Read more >
Tracking errors in Angular with Sentry - DEV Community ‍ ‍
Sentry is an open-source error tracking solution that'll allow you to log errors beyond the browser console. You can run your own server...
Read more >
JavaScript - Docs - Sentry Documentation
js", sourceMapFilename: "[name].js.map" } // other configuration };. In case you use SourceMapDevToolPlugin for more fine- ...
Read more >
sentry Changelog - PyUp.io
Use new SDK identifier `sentry.javascript.react-native` ... fix(angular): Add check for global.location in angular universal (4513) - fix(nextjs): Stop ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found