Fix: Cronitor RUM history patching error

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 15:08:52 +00:00
parent 0106bdb1d5
commit c1ef28e2f6

View File

@@ -131,6 +131,17 @@ function NavigationTracker() {
}
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 (
<TooltipProvider>
<NavigationTracker />
@@ -388,19 +399,7 @@ function AppContent(): 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 (
const App = (): React.JSX.Element => (
<QueryClientProvider client={queryClient}>
<AuthProvider>
<AuthModalProvider>
@@ -415,6 +414,5 @@ const App = (): React.JSX.Element => {
<AnalyticsWrapper />
</QueryClientProvider>
);
};
export default App;