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

Disabling sentry in development while using angular plugin #541

Closed
robinschuere opened this issue Mar 30, 2016 · 3 comments
Closed

Disabling sentry in development while using angular plugin #541

robinschuere opened this issue Mar 30, 2016 · 3 comments

Comments

@robinschuere
Copy link

Running Raven install

// setup getSentry
if (config.env !== 'local') {
    //this should occur when we are in production
    Raven
        .config(__DNSLINK__);
} else {
    //this should occur when we don't want the sentry
    Raven
        .config(false);
}
Raven
    .addPlugin(angularPlugin, angular)
    .install();

const app = angular
    .module('app', [
        'ngRaven'])
    ...

Whenever the config(false) is called, the app crashes with the following error: Module 'ngRaven' is not available!

I tried the config with below setups, but they return the same message:

.config('');
.config(false);

Any help is appreciated.

@robinschuere
Copy link
Author

I created a workaround by adding a new jsFile (named ngRaven) with the following code

import angular from 'angular';

export default angular
    .module('ngRaven', [])
    .name;

this module is added in the index.js file before the import of the angularplugin file from raven-js.

import { ngRaven } from './ngRaven';
import { angularPlugin } from './node_modules/raven-js/plugins/angular'

it's dirty but it works

@chancez
Copy link

chancez commented Feb 15, 2017

I was able to find a work around which basically stubs out a few methods on the Raven object, which allows the angular plugin to properly be installed, despite having no DSN.

See my comment here: #436 (comment)

@benvinegar
Copy link
Contributor

Duplicate of #436, closing.

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

3 participants