vercel/turborepo · error · DownloadError
isErrorLike(reason) ? reason.message : String(reason)
Error message
isErrorLike(reason) ? reason.message : String(reason)
What it means
createProject() in @turbo/utils (the create-turbo project creation flow) wraps its entire download-and-extract phase in try/catch and rethrows any failure as a DownloadError, setting the message from the original error via isErrorLike(). It is a wrapper error: the message can be a network failure text, an HTTP status, 'Invalid example name: ...', or a tar extraction error.
Source
Thrown at packages/turbo-utils/src/create-project.ts:214
} catch {
// ignore
}
if (packageJsonContent) {
// read the scripts from the package.json
availableScripts.push(...Object.keys(packageJsonContent.scripts || {}));
}
}
let cdPath: string = appPath;
if (path.join(originalDirectory, appName) === appPath) {
cdPath = appName;
}
return { cdPath, hasPackageJson, availableScripts, repoInfo };
} catch (reason) {
loader.stop();
throw new DownloadError(
isErrorLike(reason) ? reason.message : String(reason)
);
}
}
View on GitHub (pinned to 9f94a7d215)
Solutions
- Read the wrapped message — it names the real failure; fix that root cause first (connectivity, example/repo name)
- Verify the example name matches a directory under github.com/vercel/turborepo/examples, or that the repo shorthand owner/repo and branch are correct
- If behind a proxy, configure HTTPS_PROXY/git proxy settings or download the example manually
- Retry once after fixing connectivity; note createProject already retries downloads 3 times, so persistent failures are not transient
Defensive patterns
Strategy: retry
Type guard
import { DownloadError } from "@turbo/utils/create-project";
function isDownloadError(e: unknown): e is DownloadError {
return e instanceof DownloadError; // class is `export class DownloadError extends Error {}`
} Try / catch
import { retry } from "@turbo/utils";
try {
await retry(() => createProject({ ... }), { retries: 3 });
} catch (e) {
if (e instanceof DownloadError) {
// inspect e.message — it carries the underlying failure text
} else throw e;
} Prevention
- Validate example/repo names before invoking creation flows
- Wrap creation in retry with backoff; downloads are the flakiest step
- Surface the wrapped message to users rather than the generic DownloadError name
When it happens
Trigger: Any exception during the download phase: downloadAndExtractExample/downloadAndExtractRepo failing (offline, proxy blocking codeload.github.com or github.com, 404 for a bad example/repo), an invalid example name, abort due to download timeout, or tar extraction/write errors.
Common situations: Corporate proxy or VPN blocking GitHub downloads; typo in the example name or repo shorthand (owner/repo#branch); flaky networks in CI; disk full during extraction.
Related errors
- Unable to write .gitignore
- Unable to read package.json
- Unable to write package.json
- Unable to update README.md
- Failed to download: ${response.status}
AI-assisted analysis of vercel/turborepo@9f94a7d215 (2026-08-16).
Data as JSON: /api/errors/7764cdb96b993382.
Report an issue: GitHub.