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

Using Sentry.setShouldSendCallback causes Invariant Violation in AppRegistry #268

Closed
3 tasks
rdev opened this issue Oct 16, 2017 · 6 comments
Closed
3 tasks
Assignees

Comments

@rdev
Copy link

rdev commented Oct 16, 2017

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

Config:

Sentry.config('https://[email protected]/...').install()

I have following issue:

When trying to disable reporting in dev mode the app crashes on startup.

Steps to reproduce:
Set the config
Set Sentry.setShouldSendCallback(() => false);
Run the app

Actual result:
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

Expected result:
App launching

@HazAT
Copy link
Member

HazAT commented Oct 16, 2017

Hey, are you sure this is related to react-native-sentry?
If you don't want to report in dev just don't call install()

if (__DEV__ === true) {
....
}

@HazAT HazAT self-assigned this Oct 16, 2017
@rdev
Copy link
Author

rdev commented Oct 16, 2017

@HazAT thanks for the prompt reply! When I comment out Sentry stuff altogether it still sends the reports

@HazAT
Copy link
Member

HazAT commented Oct 16, 2017

hmm, this does not make sense, Sentry only sends stuff if you call install.
Can you paste the part of your code where you include and use Sentry?

@rdev
Copy link
Author

rdev commented Oct 16, 2017

import { AppRegistry } from 'react-native';
import { Sentry } from 'react-native-sentry';
import app from './app'

Sentry.config('https://[email protected]/...').install(); // <-- if this is commented and I throw something, it shows up in Sentry anyway

AppRegistry.registerComponent('app', () => app);

@HazAT
Copy link
Member

HazAT commented Oct 16, 2017

I've just tried it if I comment out this line it does nothing.
Make sure you have this call nowhere else.

@rdev
Copy link
Author

rdev commented Oct 16, 2017

Somehow cleaning my android build and re-installing the app on the device fixed it.
Thanks for your help!

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

2 participants