{"record":{"id":"2ecd05025c794d21","repo":"nikivdev/code","slug":"cloudflare-env-source-must-be-set-to-cloud-flo","errorCode":null,"errorMessage":"cloudflare.env_source must be set to \"cloud\", \"flow\", or \"local\" to apply envs","messagePattern":"cloudflare\\.env_source must be set to \"cloud\", \"flow\", or \"local\" to apply envs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/deploy.rs","lineNumber":1225,"sourceCode":"    ensure_wrangler_config(&worker_path)?;\n\n    let env_name = cf_cfg.environment.as_deref();\n    let mut keys: Vec<_> = secrets.keys().cloned().collect();\n    keys.sort();\n    for key in keys {\n        if let Some(value) = secrets.get(&key) {\n            println!(\"  Setting secret {}...\", key);\n            set_wrangler_secret_value(&worker_path, env_name, &key, value)?;\n        }\n    }\n\n    Ok(())\n}\n\nfn apply_cloudflare_env_from_config(project_root: &Path, cf_cfg: &CloudflareConfig) -> Result<()> {\n    let source = cf_cfg.env_source.as_deref();\n    if !is_cloud_source(source) && !is_flow_source(source) {\n        bail!(\n            \"cloudflare.env_source must be set to \\\"cloud\\\", \\\"flow\\\", or \\\"local\\\" to apply envs\"\n        );\n    }\n\n    let cloud_env = cf_cfg.environment.as_deref().unwrap_or(\"production\");\n    let keys = collect_cloudflare_env_keys(cf_cfg);\n    let fetch = || crate::env::fetch_project_env_vars(cloud_env, &keys);\n    let vars = if is_flow_source(source) && source == Some(\"local\") {\n        with_local_env_backend(fetch)?\n    } else {\n        fetch()?\n    };\n    if vars.is_empty() {\n        bail!(\n            \"No env vars found in env store for environment '{}'\",\n            cloud_env\n        );\n    }","sourceCodeStart":1207,"sourceCodeEnd":1243,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/deploy.rs#L1207-L1243","documentation":"Error \"cloudflare.env_source must be set to \"cloud\", \"flow\", or \"local\" to apply envs\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/deploy.rs:1225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}