{"record":{"id":"e9d94986db671ac2","repo":"jdx/mise","slug":"unsupported-yaml-value-v","errorCode":null,"errorMessage":"unsupported yaml value: {v:?}","messagePattern":"unsupported yaml value: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/env_directive/file.rs","lineNumber":164,"sourceCode":"                    \"yaml\",\n                )\n                .await?;\n                if !decrypted.is_empty() {\n                    f = serde_yaml::from_str(&decrypted).wrap_err_with(errfn)?;\n                } else {\n                    return Ok(EnvMap::new());\n                }\n            }\n            f.env\n                .into_iter()\n                .map(|(k, v)| {\n                    Ok((\n                        k,\n                        match v {\n                            serde_yaml::Value::String(s) => s,\n                            serde_yaml::Value::Number(n) => n.to_string(),\n                            serde_yaml::Value::Bool(b) => b.to_string(),\n                            _ => bail!(\"unsupported yaml value: {v:?}\"),\n                        },\n                    ))\n                })\n                .collect()\n        } else {\n            Ok(EnvMap::new())\n        }\n    }\n\n    async fn toml<PT>(\n        config: &Arc<Config>,\n        exec_env: &TeraEnvMap,\n        p: &Path,\n        parse_template: PT,\n    ) -> Result<EnvMap>\n    where\n        PT: FnMut(String) -> Result<String>,\n    {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/config/env_directive/file.rs#L146-L182","documentation":"The YAML variant of the env directive file loader accepts only string, number, and boolean values, converting each to a string. Any other YAML value — null (empty value), sequences, or nested mappings — cannot become an environment variable and triggers this error, with the debug value identifying the culprit key.","triggerScenarios":"Loading a YAML env file where a key's value is null, a list (e.g. `- a`), or a nested map; this includes the very common `KEY:` with no value, which YAML parses as null.","commonSituations":"YAML env files converted from docker-compose or other tools that allow nested config; empty values written as `KEY:` (null); lists used for multi-value variables.","solutions":["Quote or fill every value: `KEY: \"\"` instead of bare `KEY:` for empty strings.","Flatten nested mappings into flat keys and turn lists into comma-separated strings.","Lint the file so all values are scalars before wiring it into the env directive."],"exampleFix":"# before\nLOG_LEVEL:\nEXTRA:\n  - a\n  - b\n# after\nLOG_LEVEL: \"\"\nEXTRA: \"a,b\"","handlingStrategy":"validation","validationCode":"# Detect null (bare key) and non-scalar values in a YAML env file\nyq -e '... style=\"flow\" | to_entries | all(.value tag == \"!!str\" or .value tag == \"!!int\" or .value tag == \"!!bool\")' env.yaml || echo 'found non-scalar env value'","typeGuard":"const isEnvScalar = (v) =>\n  typeof v === 'string' || typeof v === 'number' || typeof v === 'boolean';","tryCatchPattern":null,"preventionTips":["Write `KEY: \"\"` instead of a bare `KEY:` (which YAML reads as null)","Convert lists to comma-separated strings; flatten nested maps","Run a YAML linter over env files before committing them"],"tags":["env","yaml","config"],"backgroundTag":"invalid-env-var-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}