mantinedev/mantine · error · Error

[@mantine/schedule] MobileMonthView: Duplicated event ids fo

Error message

[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}

What it means

MobileMonthView validates event id uniqueness while grouping events by date for the month display on small screens. If the same id appears more than once among the month's events, this error is thrown during render.

Source

Thrown at packages/@mantine/schedule/src/components/MobileMonthView/get-mobile-month-view-events.ts:59

  if (events === undefined) {
    return groupedEvents;
  }

  const ids = new Set<string | number>();

  for (const event of events) {
    if (event.display === 'background') {
      continue;
    }

    if (dayjs(event.start).isSame(dayjs(date), 'month')) {
      groupEventByDate(validateEvent(event), groupedEvents);

      if (!ids.has(event.id)) {
        ids.add(event.id);
      } else {
        throw new Error(
          `[@mantine/schedule] MobileMonthView: Duplicated event ids found: ${event.id}`
        );
      }
    }
  }

  return groupedEvents;
}

View on GitHub (pinned to 8a284e2c2c)

Solutions

  1. Deduplicate the events array by id before passing it to Schedule
  2. Assign unique ids when expanding recurring events
  3. Fix the backend or fetch layer that returns duplicated records

Example fix

// before
<Schedule events={rawEvents} />;

// after
const events = [...new Map(rawEvents.map((e) => [e.id, e])).values()];
<Schedule events={events} />;
Defensive patterns

Strategy: validation

Validate before calling

const unique = [...new Map(events.map((e) => [e.id, e])).values()];

<Schedule events={unique} />;

Type guard

function hasUniqueEventIds(events: { id: string | number }[]): boolean {
  return new Set(events.map((e) => e.id)).size === events.length;
}

Prevention

When it happens

Trigger: Passing duplicated event ids to Schedule when the mobile month view is rendered; the same event appearing twice because a data transform appended it for each day it spans.

Common situations: Responsive testing on mobile widths exposing duplicates that desktop views also reject; merging event feeds; recurring events expanded without unique per-occurrence ids.

Related errors


AI-assisted analysis of mantinedev/mantine@8a284e2c2c (2026-08-28). Data as JSON: /api/errors/b922a4c135d373f7. Report an issue: GitHub.