toeverything/AFFiNE · error · UserFriendlyError

UNSUPPORTED_SERVER_VERSION

UNSUPPORTED_SERVER_VERSION

Error message

Unsupported server with version [${receivedVersion}], required version is [>=${MIN_SUPPORTED_SERVER_VERSION}].

What it means

Factory producing a UserFriendlyError (HTTP 426, UNSUPPORTED_SERVER_VERSION) when the connected self-hosted server reports a version older than MIN_SUPPORTED_SERVER_VERSION. The client refuses to run against it because API/schema compatibility cannot be assumed; 'unknown' is used when the server exposed no version.

Source

Thrown at packages/frontend/core/src/modules/cloud/stores/server-config.ts:38

  /failed to fetch/i,
  /network request failed/i,
  /fetch failed/i,
  /load failed/i,
  /networkerror/i,
  /cors/i,
  /certificate/i,
  /ssl/i,
  /err_[a-z_]+/i,
];

const MISSING_SERVER_VERSION_PATTERNS = [
  /cannot query field ["']?version["']? on type ["']?serverconfigtype["']?/i,
  /field ["']?version["']? is not defined by type ["']?serverconfigtype["']?/i,
];

export function createUnsupportedServerVersionError(version?: string | null) {
  const receivedVersion = version || 'unknown';
  return new UserFriendlyError({
    status: 426,
    code: 'UNSUPPORTED_SERVER_VERSION',
    type: 'UNSUPPORTED_SERVER_VERSION',
    name: 'UNSUPPORTED_SERVER_VERSION',
    message: `Unsupported server with version [${receivedVersion}], required version is [>=${MIN_SUPPORTED_SERVER_VERSION}].`,
    data: {
      serverVersion: receivedVersion,
      requiredVersion: `>=${MIN_SUPPORTED_SERVER_VERSION}`,
    },
  });
}

export function isSupportedServerVersion(version?: string | null) {
  const normalized = version && semver.valid(version, { loose: true });
  return (
    !!normalized &&
    semver.gte(normalized, `${MIN_SUPPORTED_SERVER_VERSION}-0`, {
      loose: true,

View on GitHub (pinned to 591f874dad)

Solutions

  1. Upgrade the server to the minimum supported version.
  2. Use a client version compatible with the server.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown by assertSupportedServerVersion when the connected server's version is missing or semver-below MIN_SUPPORTED_SERVER_VERSION.

Common situations: The client connected to an outdated self-hosted server. Upgrade the AFFiNE server to the required minimum version to continue.


AI-assisted analysis of toeverything/AFFiNE@591f874dad (2026-08-18). Data as JSON: /api/errors/e30258cd256f5e80. Report an issue: GitHub.