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
- Use one of: docker, aws, azure, tart
- Check the exact --cloud flag / cloud config key spelling
- 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
- Validate the --cloud CLI flag against the known set before dispatching
- Make new provider names fail loudly at parse time instead of deep in getCloud
- Document the supported provider list next to the CLI flag help
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
- Invalid boolean value: ${v}
- Unsupported platform: ${inspect(options)}
- Unsupported os: ${cloudInit["os"]}
- Wrong first byte
- Wrong second byte
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/7274134ea9718205.
Report an issue: GitHub.