From 69b14def582010b3638a846009c0980d6d9d90e2 Mon Sep 17 00:00:00 2001 From: gh0stdotexe Date: Tue, 12 Sep 2023 00:16:30 -0700 Subject: [PATCH] fix broken JS --- src/index.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index d17f3b12..7fa27ee7 100644 --- a/src/index.js +++ b/src/index.js @@ -30,6 +30,35 @@ const app = ( ) +if (process.env.BUGSNAG_KEY) { + Bugsnag.start({ + apiKey: process.env.BUGSNAG_KEY, + plugins: [new BugsnagPluginReact()], + enabledReleaseStages: ['production', 'staging'], + releaseStage: process.env.NODE_ENV + }) + + const ErrorBoundary = Bugsnag.getPlugin('react') + .createErrorBoundary(React) + + ReactDOM.render( + + {app} + , + document.getElementById('root') + ); +}else{ + ReactDOM.render( + app, + document.getElementById('root') + ); +} + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); + import { inject } from '@vercel/analytics'; -inject(); +inject(); \ No newline at end of file