oven-sh/bun · error · Error

failed to fetch tag for vendor

Error message

failed to fetch tag ${tag} for vendor '${name}': ${error}

What it means

Thrown while preparing a vendored dependency for tests: after the vendor repo is cloned (or already present), the runner does a shallow `git fetch --depth 1 origin tag <tag>` to obtain the pinned tag. If git exits non-zero (bad tag name, network failure, auth error), spawnSafe reports !ok and this error wraps git's stderr so the fetch failure is distinguishable from the preceding clone failure.

Solutions

  1. Verify the tag exists in the vendor's repository
  2. Retry the fetch for transient network errors
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at scripts/runner.node.mjs:2415 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/8cce2796002c176a. Report an issue: GitHub.

Appendix: source

Thrown at scripts/runner.node.mjs:2415

        const vendorPath = join(cwd, "vendor", name);

        if (!existsSync(vendorPath)) {
          const { ok, error } = await spawnSafe({
            command: "git",
            args: ["clone", "--depth", "1", "--single-branch", repository, vendorPath],
            timeout: testTimeout,
            cwd,
          });
          if (!ok) throw new Error(`failed to git clone vendor '${name}': ${error}`);
        }

        let { ok, error } = await spawnSafe({
          command: "git",
          args: ["fetch", "--depth", "1", "origin", "tag", tag],
          timeout: testTimeout,
          cwd: vendorPath,
        });
        if (!ok) throw new Error(`failed to fetch tag ${tag} for vendor '${name}': ${error}`);

        ({ ok, error } = await spawnSafe({
          command: "git",
          args: ["checkout", tag],
          timeout: testTimeout,
          cwd: vendorPath,
        }));
        if (!ok) throw new Error(`failed to checkout tag ${tag} for vendor '${name}': ${error}`);

        const packageJsonPath = join(vendorPath, "package.json");
        if (!existsSync(packageJsonPath)) {
          throw new Error(`Vendor '${name}' does not have a package.json: ${packageJsonPath}`);
        }

        const testPathPrefix = testPath || "test";
        const testParentPath = join(vendorPath, testPathPrefix);
        if (!existsSync(testParentPath)) {
          throw new Error(`Vendor '${name}' does not have a test directory: ${testParentPath}`);

View on GitHub (pinned to 8c5296ac45)