This commit is contained in:
17
instrumentation.ts
Normal file
17
instrumentation.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
|
||||
// Next.js will call this on boot for the active runtime.
|
||||
// We dynamically import the correct Sentry config file.
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
await import('./sentry.server.config');
|
||||
}
|
||||
|
||||
if (process.env.NEXT_RUNTIME === 'edge') {
|
||||
await import('./sentry.edge.config');
|
||||
}
|
||||
}
|
||||
|
||||
// Capture errors from Server Components, middleware and route handlers.
|
||||
export const onRequestError = Sentry.captureRequestError;
|
||||
|
||||
Reference in New Issue
Block a user