windmill-labs/windmill · warning

Failed to install bun-types automatically: ${e instanceof Er

Error message

Failed to install bun-types automatically: ${e instanceof Error ? e.message : e}

What it means

`wmill refresh tsconfig` ensures bun-types is installed so Bun API autocompletion works. If the package is missing, it attempts `bun add -d bun-types` automatically; when that shell command fails (non-zero exit or spawn error), it warns with the underlying message and tells the user to install manually.

Source

Thrown at cli/src/commands/refresh/tsconfig.ts:432

  try {
    execSync("bun --version", { stdio: "ignore" });
  } catch {
    log.info(
      "Install bun (https://bun.sh), run 'bun add -d bun-types', then re-run 'wmill refresh tsconfig' for Bun API autocompletion."
    );
    return false;
  }

  try {
    log.info(
      colors.yellow("Installing bun-types with 'bun add -d bun-types'...")
    );
    execSync("bun add -d bun-types", { stdio: "inherit" });
    log.info(colors.green("Installed bun-types."));
    return true;
  } catch (e) {
    log.warn(
      `Failed to install bun-types automatically: ${
        e instanceof Error ? e.message : e
      }`
    );
    log.info(
      "Run 'bun add -d bun-types' manually, then 'wmill refresh tsconfig', for Bun API autocompletion."
    );
    return false;
  }
}

/**
 * One-line, non-blocking warning (to stderr) when the managed config is out of
 * date. Mirrors the prompts freshness check (`warnIfPromptsStale`) exactly:
 * gated on the *managed* file existing (= the project opted in by running
 * init/refresh), and only ever warns that it's **stale** — never about a
 * missing or unlinked user tsconfig.json. So a deliberately-unlinked / custom
 * setup is never nagged, and a not-yet-initialized project stays silent.

View on GitHub (pinned to e474e8803c)

Solutions

  1. Install bun-types manually with `bun add -d bun-types` (or `npm i -D bun-types` if bun is unavailable), then re-run `wmill refresh tsconfig`
  2. Install Bun itself (https://bun.sh) if it is missing, then retry the refresh
  3. Check network/registry connectivity or proxy settings if `bun add` failed on fetch

Example fix

// before
# wmill refresh tsconfig
# Failed to install bun-types automatically: Command failed: bun add -d bun-types
// after
bun add -d bun-types
wmill refresh tsconfig
Defensive patterns

Strategy: fallback

Validate before calling

which bun && bun pm ls | grep -q bun-types || echo 'bun-types missing'

Try / catch

try { execSync('bun add -d bun-types', {stdio:'inherit'}); } catch { execSync('npm i -D bun-types', {stdio:'inherit'}); }

Prevention

When it happens

Trigger: Bun is not installed or not on PATH, the project has no package.json / is not a bun workspace, network/registry access fails during `bun add`, or bun exits with a lockfile/permission error.

Common situations: Developing in an environment with only npm/yarn/pnpm installed; corporate proxy blocking the npm registry; running the command outside the package root so `bun add` has no manifest to update.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/51109a691c920c6a. Report an issue: GitHub.