nikivdev/code · error

No production deploy config found in flow.toml. Add one of:

Error message

No production deploy config found in flow.toml.

Add one of:
[host]
dest = "/opt/myapp"
run = "./server"

[cloudflare]
path = "worker"

[railway]
project = "my-project"

[web]
path = "packages/web"

Or define a deploy-prod/prod task.

What it means

run_prod_with_project_context (production deploy) checks for production-capable config — [host], [cloudflare], [railway], or [web] — and for a deploy-prod/prod task; if none exists it bails with an extended message (it differs from error 395 by also accepting [web] and prod tasks). The library requires an explicit production target before deploying.

Source

Thrown at src/deploy.rs:503

                    println!("Detected [cloudflare] config, deploying to Cloudflare...");
                    if let Err(err) = ensure_prod_cloudflare_routes(&project_root, cfg) {
                        eprintln!("WARN prod route setup skipped: {err}");
                    }
                    return deploy_cloudflare(&project_root, Some(cfg), false, false);
                }

                if cfg.railway.is_some() {
                    println!("Detected [railway] config, deploying to Railway...");
                    return deploy_railway(&project_root, Some(cfg));
                }

                if cfg.web.is_some() {
                    println!("Detected [web] config, deploying web...");
                    return deploy_web(&project_root, Some(cfg));
                }
            }

            bail!(
                "No production deploy config found in flow.toml.\n\n\
                Add one of:\n\
                [host]\n\
                dest = \"/opt/myapp\"\n\
                run = \"./server\"\n\n\
                [cloudflare]\n\
                path = \"worker\"\n\n\
                [railway]\n\
                project = \"my-project\"\n\n\
                [web]\n\
                path = \"packages/web\"\n\n\
                Or define a deploy-prod/prod task."
            );
        }
        Some(DeployAction::Host {
            remote_build,
            setup,
        }) => deploy_host(&project_root, flow_config.as_ref(), remote_build, setup),

View on GitHub (pinned to a747e741ae)

Solutions

  1. Add a production section to flow.toml (e.g. `[host]` with dest/run for the prod server).
  2. Define a `deploy-prod` or `prod` task in flow.toml if your prod flow is custom.
  3. If this project deploys only a web package, add `[web]` with the package path.
  4. Copy the deploy section from the sibling project's flow.toml and adapt values.

Example fix

# before: no prod target
# after
[host]
dest = "/opt/myapp-prod"
run = "./server"
Defensive patterns

Strategy: validation

Validate before calling

// Shell: ensure a production target exists before `f deploy prod`
grep -qE '^\[(host|cloudflare|railway|web)\]' flow.toml \
  || grep -qE '^\[deploy_task\.(deploy-prod|prod)\]' flow.toml \
  || { echo "no prod deploy config in flow.toml"; exit 1; }

Prevention

When it happens

Trigger: Running `f deploy prod` on a flow.toml that has none of [host]/[cloudflare]/[railway]/[web] and no deploy-prod or prod task defined.

Common situations: Project configured only for local dev; team uses a differently-named prod task so the built-in lookup misses it; config file regenerated by setup without production sections; editing the wrong flow.toml in a monorepo.

Related errors


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