nikivdev/code · error

Multiple Cloudflare worker configs found. Set [cloudflare].p

Error message

Multiple Cloudflare worker configs found. Set [cloudflare].path in flow.toml.

What it means

Error "Multiple Cloudflare worker configs found. Set [cloudflare].path in flow.toml." thrown in nikivdev/code.

Source

Thrown at src/deploy.rs:1500

fn setup_cloudflare(project_root: &Path, config: Option<&Config>) -> Result<()> {
    let default_cf = CloudflareConfig::default();
    let cf_cfg = config
        .and_then(|c| c.cloudflare.as_ref())
        .unwrap_or(&default_cf);

    if is_cloud_source(cf_cfg.env_source.as_deref()) {
        let worker_path = if let Some(path) = cf_cfg.path.as_ref() {
            project_root.join(path)
        } else {
            let workers = discover_wrangler_configs(project_root)?;
            if workers.is_empty() {
                println!("No Cloudflare Worker config found (wrangler.toml/json).");
                println!("Run `wrangler init` first, then try: f deploy setup");
                return Ok(());
            }
            if workers.len() > 1 {
                bail!(
                    "Multiple Cloudflare worker configs found. Set [cloudflare].path in flow.toml."
                );
            }
            workers[0].clone()
        };

        ensure_wrangler_config(&worker_path)?;
        println!("Using Cloudflare worker: {}", worker_path.display());

        let env_name = cf_cfg
            .environment
            .clone()
            .unwrap_or_else(|| "production".to_string());
        maybe_bootstrap_secrets(&worker_path, cf_cfg, &env_name)?;
        let keys = collect_cloudflare_env_keys(cf_cfg);
        let env_store_ok = if keys.is_empty() {
            true
        } else {

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/deploy.rs:1500 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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