calcom/cal.diy · error · Error

Could not install Google Meet

Error message

Could not install Google Meet

What it means

Thrown by the useAddAppMutation React Query mutation when options.installGoogleVideo is true but the app 'type' being installed is not 'google_calendar'. Google Meet video is installed as a side-effect of connecting a Google Calendar account, so the hook rejects attempts to attach it to any other integration (e.g. outlook_calendar, or an '_other_calendar' variant). It is a synchronous throw inside mutationFn, so it surfaces in the mutation's error state rather than over the network.

Source

Thrown at packages/app-store/_utils/useAddAppMutation.ts:65

      let type: string | null | undefined;
      const teamId = variables && variables.teamId ? variables.teamId : undefined;
      const defaultInstall = variables && variables.defaultInstall ? variables.defaultInstall : undefined;
      const returnTo = options?.returnTo
        ? options.returnTo
        : variables && variables.returnTo
        ? variables.returnTo
        : undefined;
      if (variables === "") {
        type = _type;
      } else {
        type = variables.type;
      }
      if (type?.endsWith("_other_calendar")) {
        type = type.split("_other_calendar")[0];
      }

      if (options?.installGoogleVideo && type !== "google_calendar")
        throw new Error("Could not install Google Meet");

      const state: IntegrationOAuthCallbackState = {
        onErrorReturnTo,
        fromApp: true,
        ...(teamId && { teamId }),
        ...(type === "google_calendar" && { installGoogleVideo: options?.installGoogleVideo }),
        ...(returnTo && { returnTo }),
        ...(defaultInstall && { defaultInstall }),
      };

      const stateStr = JSON.stringify(state);
      const searchParams = generateSearchParamString({
        stateStr,
        teamId,
        returnTo,
      });

      const res = await fetch(`/api/integrations/${type}/add${searchParams}`);

View on GitHub (pinned to 176037d0af)

Solutions

  1. Only set installGoogleVideo: true when the selected integration type is 'google_calendar'.
  2. Disable/toggle off the Google Meet checkbox whenever a non-Google calendar is selected.
  3. If Google Meet is genuinely required, install a google_calendar credential first.
  4. Pass the resolved type through the same control that sets installGoogleVideo so they cannot disagree.

Example fix

// before
const mutation = useAddAppMutation(null, { installGoogleVideo: meetEnabled });
mutation.mutate({ type: selectedType }); // throws if selectedType !== 'google_calendar'

// after
const mutation = useAddAppMutation(null, {
  installGoogleVideo: meetEnabled && selectedType === 'google_calendar',
});
mutation.mutate({ type: selectedType });
Defensive patterns

Strategy: validation

Validate before calling

const canInstallMeet = (type: string | null | undefined) =>
  !meetEnabled || type === 'google_calendar';
if (!canInstallMeet(selectedType)) {
  // do not call mutate; warn the user instead
}

Type guard

const isGoogleCalendar = (type: unknown): type is 'google_calendar' =>
  type === 'google_calendar';

Try / catch

// React Query onError receives this sync throw
mutation.mutate(vars, {
  onError: (err) => {
    if (err.message === 'Could not install Google Meet') {
      setMeetEnabled(false); // auto-correct the toggle
    }
  },
});

Prevention

When it happens

Trigger: Calling mutate({ type: 'outlook_calendar' }) while the hook was created with installGoogleVideo: true; selecting a non-Google calendar in the install UI while the 'also install Google Meet' toggle is on; an '_other_calendar' variant that splits to a non-google base type.

Common situations: Multi-calendar install dropdown where the Meet checkbox stays enabled after switching providers; default-install flow passing the wrong app type; stale UI state after the user changes their calendar selection.

Related errors


AI-assisted analysis of calcom/cal.diy@176037d0af (2026-08-12). Data as JSON: /api/errors/26ab1920a22224a2. Report an issue: GitHub.