From 0ef3d19f08669d5ef9d91a8affbb533ce4c3d14b Mon Sep 17 00:00:00 2001 From: Marco Gallegos Date: Sun, 18 Jan 2026 10:41:47 -0600 Subject: [PATCH] Fix build error by making Google Calendar JSON non-critical - Don't throw error if GOOGLE_SERVICE_ACCOUNT_JSON is invalid - Just warn and continue with Google Calendar disabled - Allow build to complete even if Google Calendar config is wrong - Prevent 'Failed to collect page data' build error Fixes Coolify deployment issue --- lib/google-calendar.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/google-calendar.ts b/lib/google-calendar.ts index 7073fd1..6ead714 100644 --- a/lib/google-calendar.ts +++ b/lib/google-calendar.ts @@ -53,11 +53,13 @@ class GoogleCalendarService { } catch (jsonError) { console.error('GoogleCalendar: Failed to parse GOOGLE_SERVICE_ACCOUNT_JSON', jsonError); console.error('GoogleCalendar: Service account JSON value:', serviceAccountJson); - throw new Error('Invalid GOOGLE_SERVICE_ACCOUNT_JSON format. Please check environment variable.'); + // Don't throw error - just warn and continue with Google Calendar disabled + return; } if (!credentials.type || !credentials.project_id || !credentials.private_key) { - throw new Error('Invalid GOOGLE_SERVICE_ACCOUNT_JSON: Missing required fields'); + console.warn('GoogleCalendar: Invalid GOOGLE_SERVICE_ACCOUNT_JSON - missing required fields. Calendar sync disabled.'); + return; } const auth = new google.auth.GoogleAuth({ @@ -72,7 +74,8 @@ class GoogleCalendarService { console.log('GoogleCalendar: Service initialized successfully'); } catch (error) { console.error('GoogleCalendar: Initialization failed', error); - throw error; + // Don't throw - just warn to allow build to continue + console.warn('GoogleCalendar: Continuing with Google Calendar disabled'); } }