From 94aa402f56e737114b253573dcfabe92044b3ab6 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Tue, 19 Mar 2024 10:55:54 -0400 Subject: [PATCH 1/2] Remove all Sentry error logging initiatlization from Providers --- src/providers/Providers.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/providers/Providers.tsx b/src/providers/Providers.tsx index 223e8c29e5..1f54fd8e60 100644 --- a/src/providers/Providers.tsx +++ b/src/providers/Providers.tsx @@ -1,23 +1,19 @@ import { ApolloProvider } from '@apollo/client'; import { ChakraProvider } from '@chakra-ui/react'; import { RainbowKitProvider, midnightTheme } from '@rainbow-me/rainbowkit'; -import { ReactNode, useEffect } from 'react'; +import { ReactNode } from 'react'; import { ToastContainer } from 'react-toastify'; import { WagmiConfig } from 'wagmi'; import { theme } from '../assets/theme'; import { ErrorFallback } from '../components/ui/utils/ErrorFallback'; import graphQLClient from '../graphql'; -import { FractalErrorBoundary, initErrorLogging } from '../helpers/errorLogging'; +import { FractalErrorBoundary } from '../helpers/errorLogging'; import { AppProvider } from './App/AppProvider'; import EthersContextProvider from './Ethers'; import { NetworkConfigProvider } from './NetworkConfig/NetworkConfigProvider'; import { wagmiConfig, chains } from './NetworkConfig/rainbow-kit.config'; export default function Providers({ children }: { children: ReactNode }) { - useEffect(() => { - initErrorLogging(); - }, []); - return ( Date: Tue, 19 Mar 2024 10:56:12 -0400 Subject: [PATCH 2/2] Initialize error logging directly in errorLogging file --- src/helpers/errorLogging.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/errorLogging.ts b/src/helpers/errorLogging.ts index a5d66005f7..0306b12caa 100644 --- a/src/helpers/errorLogging.ts +++ b/src/helpers/errorLogging.ts @@ -3,7 +3,7 @@ import * as Sentry from '@sentry/react'; /** * Initializes error logging. */ -export function initErrorLogging() { +function initErrorLogging() { if ( process.env.NODE_ENV === 'development' || import.meta.env.VITE_APP_SENTRY_DSN_URL === undefined @@ -27,6 +27,8 @@ export function initErrorLogging() { }); } +initErrorLogging(); + /** * Logs an error to Sentry and the console. * @param error the error to log. Strings are logged on Sentry as "messages", anything