expo / sentry-expo

MIT License
202 stars 83 forks source link

Expo not sending any error event to a server #336

Closed JaLe29 closed 1 year ago

JaLe29 commented 1 year ago

Summary

I would like to implement sentry into our expo react native application. We followed the documentation https://docs.expo.dev/guides/using-sentry/ .

After forcing a test error We don't see any errors in the sentry interface. We can see only new "release" of source maps.

image image

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

6.1.1"

Environment

expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.22000 Binaries: Node: 16.18.1 - C:\Program Files\nodejs\node.EXE Yarn: 3.3.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: AI-213.7172.25.2113.9123335 npmPackages: expo: ^48.0.17 => 48.0.17 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.71.8 => 0.71.8 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

import React from 'react';
import * as Sentry from 'sentry-expo';

import Toast from 'react-native-toast-message';
import { SENTRY_DNS } from './src/const/env';
import Index from './src/index';

setTimeout(() => {
    if (SENTRY_DNS) {
        Toast.show({
            type: 'error',
            text1: 'Sentry beforeOK',
        });
        Sentry.init({
            dsn: SENTRY_DNS,
            enableInExpoDevelopment: true,
            debug: true,
        });
        Toast.show({
            type: 'error',
            text1: 'Sentry afterOK',
        });
        setTimeout(() => {
            try {
                Toast.show({
                    type: 'error',
                    text1: 'Error',
                });
                throw new Error('my forced error');
            } catch (error) {
                Sentry.Native.captureException(error);
            }
        }, 10000);
    } else {
        Toast.show({
            type: 'error',
            text1: 'Sentry NOK',
        });
        // eslint-disable-next-line no-console
        console.log('SENTRY_DNS is not defined!');
    }
}, 10000);

const App: React.FC = () => <Index />;

export default App;
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.