mirror of
https://github.com/marcogll/AnchorOS.git
synced 2026-03-15 16:24:30 +00:00
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
This commit is contained in:
@@ -53,11 +53,13 @@ class GoogleCalendarService {
|
|||||||
} catch (jsonError) {
|
} catch (jsonError) {
|
||||||
console.error('GoogleCalendar: Failed to parse GOOGLE_SERVICE_ACCOUNT_JSON', jsonError);
|
console.error('GoogleCalendar: Failed to parse GOOGLE_SERVICE_ACCOUNT_JSON', jsonError);
|
||||||
console.error('GoogleCalendar: Service account JSON value:', serviceAccountJson);
|
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) {
|
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({
|
const auth = new google.auth.GoogleAuth({
|
||||||
@@ -72,7 +74,8 @@ class GoogleCalendarService {
|
|||||||
console.log('GoogleCalendar: Service initialized successfully');
|
console.log('GoogleCalendar: Service initialized successfully');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('GoogleCalendar: Initialization failed', 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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user