oven-sh/bun · error · Error

Failed to download

Error message

Failed to download ${url}: ${response.statusText}

What it means

Thrown by the download() helper in the DAP protocol generator when fetching the schema URL returns a non-OK HTTP status. It indicates a network failure, bad URL, or server error while retrieving the debug-adapter protocol JSON that schema() needs to generate types.

Solutions

  1. Check network access / the schema URL and re-run the generator
  2. Pin a known-good schema revision if the endpoint is temporarily down
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts:173 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts:173

  return body;
}

function toMethod(name: string): string {
  return `${name.substring(0, 1).toLowerCase()}${name.substring(1)}`;
}

function toComment(description?: string): string {
  if (!description) {
    return "";
  }
  const lines = ["/**", ...description.split("\n").map(line => ` * ${line.trim()}`), "*/"];
  return lines.join("\n");
}

async function download<T>(url: string | URL): Promise<T> {
  const response = await fetch(url);
  if (!response.ok) {
    throw new Error(`Failed to download ${url}: ${response.statusText}`);
  }
  return response.json();
}

View on GitHub (pinned to 8c5296ac45)