obytes / react-native-template-obytes

📱 A template for your next React Native project: Expo, PNPM, TypeScript, TailwindCSS, Husky, EAS, GitHub Actions, Env Vars, expo-router, react-query, react-hook-form.
https://starter.obytes.com
MIT License
2.33k stars 339 forks source link

Sentry Integration #376

Closed TimorChow closed 1 week ago

TimorChow commented 1 week ago

Summary:

Thank you very much for providing the detailed inheritance approach for sentry in the Doc, but I read the latest sentry documentation and found that the inheritance approach mentioned in the starter Doc has incompatibilities

image

Steps to reproduce:


// ReactNavigationInstrumentation
const routingInstrumentation = new Sentry.ReactNavigationInstrumentation();

export const initSentry = () => {
  Sentry.init({
    dsn: Env.SENTRY_DSN,
    // debug: Env.APP_ENV === 'development',
    integrations: [
      new Sentry.ReactNativeTracing({
        routingInstrumentation,
        enableNativeFramesTracking: true,
        // ...
      }),
    ],
  });
};

Expected behavior:

Additional notes:

version: "@sentry/react-native": "^6.1.0", template version: '6.3.2'

Tasks

yjose commented 1 week ago

Apparently, the documentation is outdated. Could you please refer to the documents here and let me know if they are working as expected?

TimorChow commented 1 week ago

@yjose It does work. But I noticed expo doctor is recommendding to use "@sentry/react-native": "~5.24.3" insteady of 6.1.0.

I guess at this point, I would follow expo's recommendation, which means Obytes Docs is still correct. Maybe at a note in Sentry page to reminder developer be careful of the version difference while adding Sentry

yjose commented 1 week ago

you are right, we should update the installation process to use expo instead of npm