meteor/meteor · error · Error

Accounts.ui.config: Can't set `requestPermissions` more than

Error message

Accounts.ui.config: Can't set `requestPermissions` more than once for ${service}

What it means

handleRequestPermissions throws if Accounts.ui._options.requestPermissions[service] is already truthy when config supplies requestPermissions for the same service again. Each external service's permission scope can only be configured once.

Source

Thrown at packages/accounts-ui-unstyled/accounts_ui.js:165

export function passwordlessSignupFields() {
  const { passwordlessSignupFields } = Accounts.ui._options;

  if (Array.isArray(passwordlessSignupFields)) {
    return passwordlessSignupFields;
  }

  if (typeof passwordlessSignupFields === 'string') {
    return [passwordlessSignupFields];
  }

  return ['EMAIL_ONLY'];
}

function handleRequestPermissions({ requestPermissions }) {
  if (requestPermissions) {
    Object.keys(requestPermissions).forEach(service => {
      if (Accounts.ui._options.requestPermissions[service]) {
        throw new Error(
          `Accounts.ui.config: Can't set \`requestPermissions\` more than once for ${service}`
        );
      }

      const scope = requestPermissions[service];

      if (!Array.isArray(scope)) {
        throw new Error(
          'Accounts.ui.config: Value for `requestPermissions` must be an array'
        );
      }

      Accounts.ui._options.requestPermissions[service] = scope;
    });
  }
}

function handleRequestOfflineToken({ requestOfflineToken }) {

View on GitHub (pinned to 5076d2f818)

Solutions

  1. Declare each service's requestPermissions exactly once.
  2. Merge all service permissions into a single config call.
  3. Remove duplicate declarations across settings and code.

Example fix

// before
Accounts.ui.config({ requestPermissions: { google: ['profile'] } });
Accounts.ui.config({ requestPermissions: { google: ['email'] } });

// after — single merged call
Accounts.ui.config({ requestPermissions: { google: ['profile', 'email'] } });
Defensive patterns

Strategy: validation

Validate before calling

function mergeRequestPermissions(newPerms) {
  const existing = Accounts.ui._options.requestPermissions;
  const merged = { ...existing };
  for (const svc of Object.keys(newPerms)) {
    if (existing[svc]) continue; // skip already-configured services
    merged[svc] = newPerms[svc];
  }
  return merged;
}

Type guard

const isServiceConfigured = (svc) => Boolean(Accounts.ui._options.requestPermissions[svc]);

Prevention

When it happens

Trigger: Calling Accounts.ui.config({ requestPermissions: { google: [...] } }) twice with the same service key; or settings + code both defining the same service.

Common situations: Two config calls in different files targeting the same OAuth service. Adding a new service and accidentally re-declaring an existing one's permissions.

Related errors


AI-assisted analysis of meteor/meteor@5076d2f818 (2026-08-13). Data as JSON: /api/errors/1b561d88939552b4. Report an issue: GitHub.