mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 06:51:12 -05:00
Fix: Cronitor RUM history patching error
This commit is contained in:
26
src/App.tsx
26
src/App.tsx
@@ -131,6 +131,17 @@ function NavigationTracker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function AppContent(): React.JSX.Element {
|
function AppContent(): React.JSX.Element {
|
||||||
|
// Initialize Cronitor RUM inside BrowserRouter (where history is available)
|
||||||
|
useEffect(() => {
|
||||||
|
Cronitor.load("0b5d17d3f7625ce8766c2c4c85c1895d", {
|
||||||
|
debug: import.meta.env.DEV, // Enable debug logs in development only
|
||||||
|
trackMode: 'history', // Automatically track page views with React Router
|
||||||
|
});
|
||||||
|
|
||||||
|
// Log successful initialization
|
||||||
|
console.log('[Cronitor] RUM initialized');
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<NavigationTracker />
|
<NavigationTracker />
|
||||||
@@ -388,19 +399,7 @@ function AppContent(): React.JSX.Element {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const App = (): React.JSX.Element => {
|
const App = (): React.JSX.Element => (
|
||||||
// Initialize Cronitor RUM on app mount
|
|
||||||
useEffect(() => {
|
|
||||||
Cronitor.load("0b5d17d3f7625ce8766c2c4c85c1895d", {
|
|
||||||
debug: import.meta.env.DEV, // Enable debug logs in development only
|
|
||||||
trackMode: 'history', // Automatically track page views with React Router
|
|
||||||
});
|
|
||||||
|
|
||||||
// Log successful initialization
|
|
||||||
console.log('[Cronitor] RUM initialized');
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<AuthModalProvider>
|
<AuthModalProvider>
|
||||||
@@ -415,6 +414,5 @@ const App = (): React.JSX.Element => {
|
|||||||
<AnalyticsWrapper />
|
<AnalyticsWrapper />
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
Reference in New Issue
Block a user