Skip to content

Commit

Permalink
Don't crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Oct 16, 2022
1 parent 4649b18 commit 3a4e76e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ const loadSentry = () => {
});
};

if ((__CLIENT__ && window?.env?.RAZZLE_SENTRY_DSN) || __SENTRY__?.SENTRY_DSN)
loadSentry();

if (__SERVER__) {
const apply = require('./server').default;
apply();
}

const Sentry = loadable.lib(
() => import(/* webpackChunkName: "s_entry-browser" */ '@sentry/browser'), // chunk name avoids ad blockers
);
Expand All @@ -46,6 +38,14 @@ const applyConfig = (config) => {
config.settings.sentryOptions = sentryOptions;
config.settings.storeExtenders = (stack) => [crashReporter, ...stack];

if (__SERVER__) {
const apply = require('./server').default;
apply();
}

if ((__CLIENT__ && window?.env?.RAZZLE_SENTRY_DSN) || __SENTRY__?.SENTRY_DSN)
loadSentry();

return config;
};

Expand Down

0 comments on commit 3a4e76e

Please sign in to comment.