dograh/ui/src/instrumentation.ts

20 lines
543 B
TypeScript
Raw Normal View History

2025-09-09 14:37:32 +05:30
import * as Sentry from '@sentry/nextjs';
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
// Enable source map support for better stack traces
if (process.env.NODE_ENV === 'development') {
const sourceMapSupport = await import('source-map-support');
sourceMapSupport.install();
}
await import('../sentry.server.config');
}
if (process.env.NEXT_RUNTIME === 'edge') {
await import('../sentry.edge.config');
}
}
export const onRequestError = Sentry.captureRequestError;