env
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m52s

This commit is contained in:
2026-01-27 23:51:48 +01:00
parent 5a5c10ca36
commit cbca29cbcf
3 changed files with 15 additions and 7 deletions

View File

@@ -1,5 +1,4 @@
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.
@@ -9,13 +8,13 @@ import { getServerAppServices } from '@/lib/services/create-services.server';
* - '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');
// Initialize server services on boot
// We do this AFTER Sentry to ensure errors during service init are caught
const { getServerAppServices } = await import('@/lib/services/create-services.server');
getServerAppServices();
}
if (process.env.NEXT_RUNTIME === 'edge') {