Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 56s
Build & Deploy / 🧪 QA (push) Successful in 2m9s
CI - Lint, Typecheck & Test / quality-assurance (pull_request) Failing after 3m30s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
26 lines
811 B
TypeScript
26 lines
811 B
TypeScript
import * as Sentry from '@sentry/nextjs';
|
|
|
|
/**
|
|
* Next.js will call this on boot for the active runtime.
|
|
*/
|
|
export async function register() {
|
|
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
await import('./sentry.server.config');
|
|
|
|
// Initialize server services on boot
|
|
// We do this AFTER Sentry to ensure errors during service init are caught
|
|
const { getConfig } = await import('@/lib/config');
|
|
getConfig(); // Trigger validation
|
|
|
|
const { getServerAppServices } = await import('@/lib/services/create-services.server');
|
|
getServerAppServices();
|
|
}
|
|
|
|
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;
|