{"record":{"id":"3e8b06de1f23196b","repo":"BoundaryML/baml","slug":"no-valid-generator-versions-found","errorCode":null,"errorMessage":"No valid generator versions found","messagePattern":"No valid generator versions found","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/language_server/src/baml_project/mod.rs","lineNumber":1547,"sourceCode":"        );\n        Err(message)\n    // If there's only one major.minor version, return it with the highest patch\n    } else if let Some((version, _)) = major_minor_versions.into_iter().next() {\n        if let Some(highest_patch) = highest_patch_by_major_minor.get(&version) {\n            // Parse the version string to create a proper semver::Version\n            if let Ok(mut v) = Version::parse(&format!(\"{version}.0\")) {\n                // Update with the highest patch version\n                v.patch = *highest_patch;\n                Ok(v.to_string())\n            } else {\n                Ok(format!(\"{version}.{highest_patch}\"))\n            }\n        } else {\n            Ok(version)\n        }\n    // Fallback to the runtime version if no valid versions were found\n    } else {\n        Err(anyhow::anyhow!(\"No valid generator versions found\"))\n    }\n}\n\nfn get_dummy_value(\n    indent: usize,\n    allow_multiline: bool,\n    t: &baml_runtime::TypeIR,\n) -> Option<String> {\n    let indent_str = \"  \".repeat(indent);\n    match t {\n        baml_runtime::TypeIR::Primitive(t, _) => {\n            let dummy = match t {\n                TypeValue::String => {\n                    if allow_multiline {\n                        format!(\n                            \"#\\\"\\n{indent1}hello world\\n{indent_str}\\\"#\",\n                            indent1 = \"  \".repeat(indent + 1)\n                        )","sourceCodeStart":1529,"sourceCodeEnd":1565,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_server/src/baml_project/mod.rs#L1529-L1565","documentation":"Fallback error from `common_version_up_to_patch`: when the map of generator versions is empty or yields no valid entry, the function cannot determine any common version (the intended fallback to the runtime version also has nothing to work with), so this generic error is returned.","triggerScenarios":"A generator block exists but declares no parseable `baml_version`, or `get_common_generator_version`/`run` invokes version resolution with zero valid generator version entries collected.","commonSituations":"Generator blocks missing the `baml_version` field; malformed version strings dropped during collection; a project with generator syntax but no valid version metadata (very old or hand-edited .baml files).","solutions":["Add an explicit `baml_version` to every generator block in your .baml files.","Ensure the version string is a valid semver (e.g. \"0.81.0\").","Reinstall/upgrade the baml CLI and client packages so defaults match.","Restart the language server after fixing the generator blocks."],"exampleFix":"// before\ngenerator lang_ts { output_type \"openai\" }\n// after\ngenerator lang_ts { output_type \"openai\" baml_version \"0.81.0\" }","handlingStrategy":"validation","validationCode":"// Ensure every generator declares baml_version before loading the project\nfor gen in generators {\n    assert!(gen.baml_version.is_some(), \"generator {} missing baml_version\", gen.name);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include an explicit baml_version in generator blocks.","Use valid semver strings only.","Keep the baml CLI and client packages on matching versions."],"tags":["versioning","config","baml","generators"],"backgroundTag":"missing-required-config-field","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}