Skip to content

Commit

Permalink
added error hint for missing mixpanel token
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantew14 committed Aug 13, 2023
1 parent 2f04c5f commit 8e3e957
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion frontend/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ const Loadable = (Component: ElementType) => (props: any) => {
if (isDebug) {
console.log(`Route: ${pathname}${search}, State: ${JSON.stringify(state)}`);
}
mixpanel_actions.trackRoutes(pathname);
try {
mixpanel_actions.trackRoutes(pathname);
} catch (e) {
if (
e instanceof TypeError &&
e.message === "Cannot read properties of undefined (reading 'disable_all_events')"
) {
throw Error('Check that mixpanel token is set');
} else {
throw e;
}
}

return (
<Suspense fallback={<LoadingScreen isDashboard={isDashboard} />}>
Expand Down

0 comments on commit 8e3e957

Please sign in to comment.