{"record":{"id":"54d60d85f0df4dd4","repo":"jdx/mise","slug":"unsupported-toml-value-v","errorCode":null,"errorMessage":"unsupported toml value: {v:?}","messagePattern":"unsupported toml value: (.+?)","errorType":"validation","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/533346cc374382b41ec5ff70536252b2e96e725c/src/config/env_directive/file.rs#L192-L228","documentation":"The TOML variant of the env directive file loader accepts only String, Integer, and Boolean values. Datetime values, floats, arrays, and inline tables cannot be mapped to environment variables and cause this bail; the debug-formatted value names the offending entry.","triggerScenarios":"Loading a TOML env file where a key is an array, inline table, float, or TOML datetime (e.g. `when = 2024-01-01` or `flags = [\"a\"]`).","commonSituations":"Env TOMLs that grew non-env sections or accidentally reused config tables; datetime/float values pasted from other TOML config; arrays used for multi-value variables.","solutions":["Change unsupported values to strings, integers, or booleans (quote dates and format floats as strings if needed).","Move non-scalar data out of the env file into general mise.toml config where appropriate.","Flatten arrays into comma-separated strings and inline tables into prefixed flat keys."],"exampleFix":"# before\nRELEASE_DATE = 2024-01-01\nFLAGS = [\"a\", \"b\"]\n# after\nRELEASE_DATE = \"2024-01-01\"\nFLAGS = \"a,b\"","handlingStrategy":"validation","validationCode":"# Ensure all top-level values are TOML strings, integers, or booleans\n# (arrays, inline tables, floats, datetimes are rejected)\ntaplo lint env.toml || echo 'fix non-scalar env values'","typeGuard":"const isTomlEnvScalar = (v) =>\n  typeof v === 'string' || typeof v === 'boolean' || Number.isInteger(v);","tryCatchPattern":null,"preventionTips":["Quote dates and stringify floats in env TOML files","Replace arrays and inline tables with flat keys or comma-joined strings","Keep env files free of general config tables that use non-scalar types"],"tags":["env","toml","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"}