oven-sh/bun · error

Unsupported cloud: ${name}

Error message

Unsupported cloud: ${name}

What it means

getCloud(name) maps provider names to implementations: 'docker', 'aws', 'azure', 'tart'. Any other string falls through the switch and throws — a CLI/config typo or an unimplemented provider request, not an infrastructure failure.

Source

Thrown at scripts/machine.mjs:1067

/**
 * @typedef Cloud
 * @property {string} name
 * @property {(options: MachineOptions) => Promise<Machine>} createMachine
 */

function getCloud(name) {
  switch (name) {
    case "docker":
      return docker;
    case "aws":
      return aws;
    case "azure":
      return azure;
    case "tart":
      return tart;
  }
  throw new Error(`Unsupported cloud: ${name}`);
}

/**
 * @typedef {"linux" | "darwin" | "windows"} Os
 * @typedef {"aarch64" | "x64"} Arch
 * @typedef {"macos" | "windowsserver" | "debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro
 */

/**
 * @typedef {Object} Platform
 * @property {Os} os
 * @property {Arch} arch
 * @property {Distro} distro
 * @property {string} release
 * @property {string} [eol]
 */

/**

View on GitHub (pinned to 8c5296ac45)

Solutions

  1. Use one of: docker, aws, azure, tart
  2. Check the exact --cloud flag / cloud config key spelling
  3. If you added a provider implementation, also add its case to getCloud in scripts/machine.mjs

Example fix

// before
const provider = getCloud('gcp');

// after
const provider = getCloud('aws');
Defensive patterns

Strategy: validation

Validate before calling

const CLOUDS = new Set(['docker', 'aws', 'azure', 'tart']);
if (!CLOUDS.has(name)) {
  throw new Error(`cloud must be one of ${[...CLOUDS].join(', ')}, got: ${name}`);
}

Type guard

const isCloudName = (v) =>
  v === 'docker' || v === 'aws' || v === 'azure' || v === 'tart';

Prevention

When it happens

Trigger: Passing --cloud gcp/do/oci or a typo like 'azr' or 'doker'; an empty cloud value reaching the switch; code adding a new provider object without wiring it into getCloud.

Common situations: Hand-typed machine CLI invocations; new contributor assuming a provider exists; config defaulting cloud to undefined.

Related errors


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/7274134ea9718205. Report an issue: GitHub.