OS:
_Platform:_
Output of node -v && npm -v && npm ls --prod --depth=0
βββ @types/[email protected]
βββ @types/[email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected] invalid
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
βββ [email protected]
npm ERR! invalid: [email protected] /Users/hyuckjunlee/Development/MCTExchange/node_modules/react-native-languages
npm ERR! invalid: [email protected] /Users/hyuckjunlee/Development/MCTExchange/node_modules/@sentry/wizard/node_modules/xcode
Config:
export const SentryUrl = 'π';
Sentry.config(SentryUrl).install();
I have following issue:
on root index.js
/** @format */
import { AppRegistry, YellowBox } from 'react-native';
import App from './src/index';
import { name as appName } from './app.json';
import Sentry from 'react-native-sentry';
import { SentryUrl } from './src/config/urls';
import CodePush from 'react-native-code-push';
Sentry.config(SentryUrl).install();
CodePush.getUpdateMetadata().then((update) => {
if (update) {
Sentry.setVersion(update.appVersion + '-codepush:' + update.label);
}
});
YellowBox.ignoreWarnings(['You should only render ...', 'Remote debugger']);
AppRegistry.registerComponent(appName, () => App);
and actual capturing exception codes Login.tsx
import Sentry from 'react-native-sentry';
...
...
@action
public submit = async () => {
try {
this.isLoading = true;
await this.props.login(this.emailAddr, this.pswd);
this.props.navigation.navigate('MainTab');
} catch (e) {
console.log(e);
Alert.alert('Hello');
!__DEV__ && Sentry.captureException(e); // Sentry is undefined!!!!!!!!!!!!!!!!!!!!!!!!
if (!e.response || e.response.status === 404) {
Alert.alert('μ€λ₯', 'μλ²λ‘λΆν° μλ΅μ΄ μμ΅λλ€.');
} else if (e.response.status === 400) {
Alert.alert('', 'μ΄λ©μΌ νΉμ λΉλ°λ²νΈκ° μ¬λ°λ₯΄μ§ μμ΅λλ€.');
} else if (e.response.status === 401) {
Alert.alert('μ€λ₯', 'μ¬μ©μ μ 보λ₯Ό λ°μ μ¬ μ μμ΅λλ€.');
} else {
Alert.alert('μ€λ₯', 'μ μ μλ μ€λ₯μ
λλ€.');
}
} finally {
this.isLoading = false;
}
};
On this code, Sentry.captureException(e) doesn't work.

||Version|
|---|---|
|react-native|0.57.8|
|react-native-sentry|0.42.2|
Hi there, I just edited this for you. Try not to post your DSN on GitHub.
I made a fool mistake.
I modify import Sentry from 'react-native-sentry' to import { Sentry } from 'react-native-sentry, it works
Most helpful comment
I made a fool mistake.
I modify
import Sentry from 'react-native-sentry'toimport { Sentry } from 'react-native-sentry, it works