Maybe I'm misunderstanding the purpose. I am looking for a solution to replace my console.log(errors) in my app as I get it ready for production. I went through the steps to add Sentry functionality to my expo managed work flow project. It seemed to work, it connects, it runs Sentry.init() just fine. But when I try to use Sentry.captureException('some exception') in place of a console.log, the app crashes and I get "Sentry.captureException is not a function". It logs THAT error in my sentry console. So the error is being passed to my sentry project. But from the documentation I'm following, Sentry.captureException should be a valid function? What am i missing? I have also tried Sentry.captureMessage with the same result.
App.js
import * as Sentry from 'sentry-expo';
Sentry.init({
dsn: 'xxxx',
enableInExpoDevelopment: true,
debug: true, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production.
});
enableScreens();
export default function App() {
return (
<NavigationContainer>
<AuthNavigator />
</NavigationContainer>
)
}
app.json expo hooks
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "myorganization",
"project": "myproject",
"authToken": "xxxx"
}
}
]
}
question from:
https://stackoverflow.com/questions/65914595/sentry-error-logging-not-working-as-expected-in-react-native-app 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…