env
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m52s
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m52s
This commit is contained in:
4
.env
4
.env
@@ -2,6 +2,10 @@
|
||||
NODE_ENV=production
|
||||
NEXT_PUBLIC_BASE_URL=https://klz-cables.com
|
||||
LOG_LEVEL=info
|
||||
PDF_DEBUG_EXCEL=0
|
||||
PDF_LOCALE=
|
||||
PDF_MATCH=
|
||||
PDF_LIMIT=0
|
||||
|
||||
# WooCommerce & WordPress
|
||||
WOOCOMMERCE_URL=https://klz-cables.com
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -9,11 +9,16 @@ export class PinoLoggerService implements LoggerService {
|
||||
if (parent) {
|
||||
this.logger = parent.child({ name });
|
||||
} else {
|
||||
// In Next.js, especially in the Edge runtime or during instrumentation,
|
||||
// pino transports (which use worker threads) can cause issues.
|
||||
// We disable transport in production and during instrumentation.
|
||||
const useTransport = !config.isProduction && typeof window === 'undefined';
|
||||
|
||||
this.logger = pino({
|
||||
name: name || 'app',
|
||||
level: config.logging.level,
|
||||
transport:
|
||||
!config.isProduction
|
||||
useTransport
|
||||
? {
|
||||
target: 'pino-pretty',
|
||||
options: {
|
||||
|
||||
Reference in New Issue
Block a user