From 535c37d0b41dfb9f0b2d5a7bda51c3091b2bb394 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Wed, 1 May 2024 15:03:59 -0500 Subject: [PATCH] Support not having bugsnag available --- packages/frontend/src/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/index.tsx b/packages/frontend/src/index.tsx index dd556cc3..a1677235 100644 --- a/packages/frontend/src/index.tsx +++ b/packages/frontend/src/index.tsx @@ -39,7 +39,9 @@ const gqlEndpoint = `${import.meta.env.VITE_SERVER_URL}/${SERVER_GQL_PATH}`; const gqlClient = new GQLClient({ gqlEndpoint }); -const ErrorBoundary = Bugsnag.getPlugin('react')!.createErrorBoundary(React); +const ErrorBoundary = bugsnagApiKey + ? Bugsnag.getPlugin('react')!.createErrorBoundary(React) + : ({ children }: any) => children; root.render(