Foundry376/Mailspring · error

Invalid ICS: no VEVENT component found

Error message

Invalid ICS: no VEVENT component found

What it means

Guard in ics-event-helpers when rescheduling: after parsing the ICS string, neither the root component nor its first sub-component is a VEVENT, so there is no event whose times can be updated. Indicates a malformed/empty calendar payload or an ICS containing only VTODO/VJOURNAL.

Source

Thrown at app/src/ics-event-helpers.ts:460

 *
 * @param ics - The original ICS string
 * @param options - New start/end times and whether it's an all-day event
 * @returns The modified ICS string
 */
export function updateEventTimes(ics: string, options: UpdateTimesOptions): string {
  // Validate inputs
  validateTimestamps(options.start, options.end);

  const ical = getICAL();
  const { root, event } = parseICSString(ics);

  const startDate = new Date(options.start * 1000);
  const endDate = new Date(options.end * 1000);
  const isAllDay = options.isAllDay ?? false;

  const vevent = root.name === 'vevent' ? root : root.getFirstSubcomponent('vevent');
  if (!vevent) {
    throw new Error('Invalid ICS: no VEVENT component found');
  }

  if (!isAllDay && options.timezone) {
    // User selected a specific timezone — encode wall-clock time in that zone.
    // This mirrors the timezone path in createICSString.
    const momentTz = require('moment-timezone');
    const startM = momentTz(startDate).tz(options.timezone);
    const endM = momentTz(endDate).tz(options.timezone);

    event.startDate = new ical.Time(
      {
        year: startM.year(),
        month: startM.month() + 1,
        day: startM.date(),
        hour: startM.hour(),
        minute: startM.minute(),
        second: startM.second(),
        isDate: false,

View on GitHub (pinned to 648c685d60)

Solutions

  1. Re-export or re-fetch the event ICS from the organizer — the payload lacks a VEVENT
  2. Validate the ICS with a calendar tool before passing it to updateEventTimes
  3. Handle non-event calendar objects upstream instead of routing them to event editing
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/src/ics-event-helpers.ts:460 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03). Data as JSON: /api/errors/375735102e16e394. Report an issue: GitHub.