This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
import * as Sentry from '@sentry/nextjs';
|
||||
import { getServerAppServices } from '@/lib/services/create-services.server';
|
||||
|
||||
// Next.js will call this on boot for the active runtime.
|
||||
// We dynamically import the correct Sentry config file.
|
||||
/**
|
||||
* Next.js will call this on boot for the active runtime.
|
||||
*
|
||||
* NEXT_RUNTIME is an environment variable automatically set by Next.js:
|
||||
* - 'nodejs' when running in the standard Node.js runtime
|
||||
* - 'edge' when running in the Edge runtime (e.g. Middleware, Edge API Routes)
|
||||
*/
|
||||
export async function register() {
|
||||
// Initialize server services on boot
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
getServerAppServices();
|
||||
}
|
||||
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
await import('./sentry.server.config');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user