nikivdev/code · error

Unknown release provider '{}'. Expected registry, task, or g

Error message

Unknown release provider '{}'. Expected registry, task, or github.

What it means

The `f release` dispatcher in run_default matches the provider subcommand against known providers (registry/task/release, github/gh). Any other provider string hits the catch-all arm and bails with this message. It guards against typos or unsupported providers being passed on the CLI.

Source

Thrown at src/release.rs:106

        .and_then(|release| release.default.as_deref())
        .or_else(|| {
            cfg.release
                .as_ref()
                .and_then(|release| release.registry.as_ref())
                .map(|_| "registry")
        })
        .unwrap_or("task");

    match provider {
        "registry" => {
            registry::publish(config_path, cfg, crate::cli::RegistryReleaseOpts::default())
        }
        "task" | "release" => run_task(ReleaseOpts {
            config: config_path.to_path_buf(),
            args: Vec::new(),
        }),
        "github" | "gh" => gh_release::run(GhReleaseCommand { action: None }),
        other => bail!(
            "Unknown release provider '{}'. Expected registry, task, or github.",
            other
        ),
    }
}

View on GitHub (pinned to a747e741ae)

Solutions

  1. Re-run with a supported provider: registry, task/release, or github/gh
  2. Check `f release --help` for the exact accepted subcommand names
  3. If a script/alias passes the provider, fix the script's argument

Example fix

// before
f release gitub
// after
f release github
Defensive patterns

Strategy: validation

Validate before calling

const PROVIDERS = ["registry", "task", "release", "github", "gh"];
function isValidReleaseProvider(p) {
  return PROVIDERS.includes(p);
}
if (!isValidReleaseProvider(args.provider)) throw new Error(`unsupported provider: ${args.provider}`);

Type guard

function isReleaseProvider(p: string): p is "registry" | "task" | "release" | "github" | "gh" {
  return ["registry", "task", "release", "github", "gh"].includes(p);
}

Try / catch

try {
  run(["f", "release", provider]);
} catch (e) {
  if (String(e).includes("Unknown release provider")) {
    console.error(`Invalid provider '${provider}'. Use registry|task|release|github|gh.`);
  } else throw e;
}

Prevention

When it happens

Trigger: Running `f release <provider>` where <provider> is not one of registry, task, release, github, or gh (e.g. `f release npm` or `f release gitub`).

Common situations: Typos like `github` misspelled; assuming other providers (npm, cargo, gitea) are supported; stale docs/scripts referencing a removed provider alias.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/e4e107bbc5b1ead4. Report an issue: GitHub.