From 7351c7ccac23fe35f52a5cea2df654867b1b571d Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Sat, 7 Jan 2023 18:35:31 +0200 Subject: [PATCH] fix Sentry import --- app/utils/sentry.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/utils/sentry.ts b/app/utils/sentry.ts index 346535b8e..188a36cd4 100644 --- a/app/utils/sentry.ts +++ b/app/utils/sentry.ts @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import {Database} from '@nozbe/watermelondb'; -import Sentry from '@sentry/react-native'; import {Breadcrumb, Event} from '@sentry/types'; import {Platform} from 'react-native'; import {Navigation} from 'react-native-navigation'; @@ -19,11 +18,16 @@ import {logError, logWarning} from './log'; export const BREADCRUMB_UNCAUGHT_APP_ERROR = 'uncaught-app-error'; export const BREADCRUMB_UNCAUGHT_NON_ERROR = 'uncaught-non-error'; +let Sentry: any; export function initializeSentry() { if (!Config.SentryEnabled) { return; } + if (!Sentry) { + Sentry = require('@sentry/react-native'); + } + const dsn = getDsn(); if (!dsn) {