{"record":{"id":"54d60d85f0df4dd4","repo":"jdx/mise","slug":"unsupported-toml-value-v","errorCode":null,"errorMessage":"unsupported toml value: {v:?}","messagePattern":"unsupported toml value: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/env_directive/file.rs","lineNumber":210,"sourceCode":"                    \"toml\",\n                )\n                .await?;\n                if !decrypted.is_empty() {\n                    f = toml::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                            toml::Value::String(s) => s,\n                            toml::Value::Integer(n) => n.to_string(),\n                            toml::Value::Boolean(b) => b.to_string(),\n                            _ => bail!(\"unsupported toml value: {v:?}\"),\n                        },\n                    ))\n                })\n                .collect()\n        } else {\n            Ok(EnvMap::new())\n        }\n    }\n\n    async fn dotenv(p: &Path, acc: &TeraEnvMap, expand: bool) -> Result<EnvMap> {\n        let errfn = || eyre!(\"failed to parse dotenv file: {}\", display_path(p));\n        // Read here rather than letting dotenvy open the file, so a byte-order mark can be taken\n        // off before the parser sees it. A mark belongs to the first key's name as far as dotenvy\n        // is concerned, and one bad line fails the whole file — so a `.env` saved by an editor\n        // that writes one is rejected entirely, naming a character nobody can see.\n        //\n        // `decode_text` rather than `read_to_string`: the latter is UTF-8 only, and Windows\n        // PowerShell 5.1's `>` and `Out-File` write UTF-16LE by default, so a `.env` saved with","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/config/env_directive/file.rs#L192-L228","documentation":"Raised by the TOML env directive parser (toml() in src/config/env_directive/file.rs) when a TOML env value is not a string, integer, or boolean. TOML arrays, tables, floats' absence in the allowed set, and datetimes all hit this bail — only scalar renderable types are accepted as env vars.","triggerScenarios":"A TOML env source contains e.g. `FLAGS = [\"a\", \"b\"]`, a sub-table `[env.Something]`, a float, or a datetime value.","commonSituations":"Arrays written intending PATH-style joins; accidental table creation via dotted keys like `env.FOO.bar = 1`; TOML dates used as values.","solutions":["Convert the value to a scalar string/integer/boolean (e.g. join arrays with `:` or `,` yourself)","Move nested tables out of env or flatten them into discrete keys","Replace float/date values with their desired string form","Inspect {v:?} in the message to see the offending TOML type"],"exampleFix":"# before\n[env]\nFLAGS = [\"a\", \"b\"]\n# after\n[env]\nFLAGS = \"a,b\"","handlingStrategy":"validation","validationCode":"// validate TOML env values are scalars before loading\nfn assert_scalar_env(t: &toml::Value) -> Result<(), String> {\n    for (k, v) in t.as_table().unwrap() {\n        if !v.is_str() && !v.is_integer() && !v.is_boolean() {\n            return Err(format!(\"env key {k} must be string/integer/boolean\"));\n        }\n    }\n    Ok(())\n}","typeGuard":"fn is_scalar_env_value(v: &toml::Value) -> bool {\n    v.is_str() || v.is_integer() || v.is_boolean()\n}","tryCatchPattern":"match toml_env() {\n    Ok(env) => env,\n    Err(e) if e.to_string().contains(\"unsupported toml value\") => {\n        // fix the key identified by the {v:?} dump, or stringify it\n        preprocessed_toml_env().expect(\"env must be scalar after preprocessing\")\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Avoid arrays and inline tables in [env]","Remember dotted keys like env.FOO.bar create forbidden sub-tables","Convert floats/dates to explicit quoted strings","Validate env TOML with a schema in CI"],"tags":["toml","env","config","unsupported-value"],"backgroundTag":"unsupported-config-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}