All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 6s
Build & Deploy / 🧪 QA (push) Successful in 2m14s
Build & Deploy / 🏗️ Build (push) Successful in 3m24s
Build & Deploy / 🚀 Deploy (push) Successful in 16s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 42m44s
Build & Deploy / 🔔 Notify (push) Successful in 2s
27 lines
676 B
TypeScript
27 lines
676 B
TypeScript
'use client';
|
|
|
|
import { useEffect } from 'react';
|
|
import { useAnalytics } from './useAnalytics';
|
|
import { AnalyticsEvents } from './analytics-events';
|
|
|
|
export default function ClientNotFoundTracker({ path }: { path: string }) {
|
|
const { trackEvent } = useAnalytics();
|
|
|
|
useEffect(() => {
|
|
trackEvent(AnalyticsEvents.ERROR, {
|
|
type: '404_not_found',
|
|
path,
|
|
});
|
|
|
|
import('@sentry/nextjs').then((Sentry) => {
|
|
Sentry.withScope((scope) => {
|
|
scope.setTag('status_code', '404');
|
|
scope.setTag('path', path);
|
|
Sentry.captureMessage(`Route Not Found: ${path}`, 'warning');
|
|
});
|
|
});
|
|
}, [trackEvent, path]);
|
|
|
|
return null;
|
|
}
|