{"record":{"id":"b9f9f9604cc74703","repo":"BoundaryML/baml","slug":"path-package-name-cannot-be-empty","errorCode":null,"errorMessage":"{path}: `[package].name` cannot be empty.","messagePattern":"(.+?): `\\[package\\]\\.name` cannot be empty\\.","errorType":"validation","errorClass":"ManifestError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_db/src/manifest.rs","lineNumber":189,"sourceCode":"    #[serde(flatten)]\n    pub unknown: IndexMap<String, toml::Value>,\n}\n\n/// Parse `baml.toml` text into the typed manifest.\npub fn parse(content: &str) -> Result<BamlToml, toml::de::Error> {\n    toml::from_str(content)\n}\n\n/// Why a manifest's `[package].name` could not be resolved.\n#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]\npub enum ManifestError {\n    #[error(\n        \"{path}: missing `[package]` table.\\nAdd:\\n\\n    [package]\\n    name = \\\"<your-project-name>\\\"\\n\"\n    )]\n    MissingPackageTable { path: std::path::PathBuf },\n    #[error(\"{path}: `[package]` is missing `name = \\\"<your-project-name>\\\"`.\")]\n    MissingPackageName { path: std::path::PathBuf },\n    #[error(\"{path}: `[package].name` cannot be empty.\")]\n    EmptyPackageName { path: std::path::PathBuf },\n    #[error(\n        \"{path}: `[dependencies]` is not supported in a project manifest yet: package imports are \\\n         pending a design pass. Remove the table; a project reaches the standard library implicitly.\"\n    )]\n    DependenciesUnsupported { path: std::path::PathBuf },\n    #[error(\n        \"{path}: `[package].prelude` is reserved for the standard library's own manifests. Remove it.\"\n    )]\n    PreludeUnsupported { path: std::path::PathBuf },\n}\n\n/// Refuse the manifest tables only the standard library's own manifests may\n/// carry. Package imports are not user surface area until they get a design\n/// pass, so a project manifest with `[dependencies]` (or the stdlib-only\n/// `[package].prelude`) is an error, not a silently ignored table.\npub fn reject_stdlib_only_tables(\n    manifest: &BamlToml,","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_db/src/manifest.rs#L171-L207","documentation":"Manifest validation error: the baml.toml at {path} has a [package] table with a name key whose value is the empty string. The package name is required to identify the project, and an empty name would break generated identifiers and manifest lookups downstream, so parsing rejects it at load time.","triggerScenarios":"Loading a manifest containing `[package]\\nname = \"\"` — typically from templated generation where a placeholder was never filled in.","commonSituations":"Unfilled template placeholders; scripted manifest generation writing an empty value; clearing the name during renaming and forgetting to set a new one.","solutions":["Set `name` to a non-empty project name in the `[package]` table.","If the name comes from a variable/template, check the variable is populated.","Validate the manifest before committing it."],"exampleFix":"// before\n[package]\nname = \"\"\n// after\n[package]\nname = \"my-project\"","handlingStrategy":"validation","validationCode":"fn name_nonempty(raw: &str) -> bool {\n    raw.parse::<toml::Value>().ok()\n        .and_then(|v| v.get(\"package\")?.get(\"name\")?.as_str().map(|s| !s.is_empty()))\n        .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match load_manifest(path) {\n    Err(ManifestError::EmptyPackageName { path }) => eprintln!(\"{path:?}: [package].name cannot be empty\"),\n    Err(e) => eprintln!(\"manifest error: {e}\"),\n    Ok(m) => m,\n}","preventionTips":["Reject empty names at template/render time.","Never interpolate unvalidated variables into the name field.","Lint manifests for empty string values."],"tags":["toml","manifest","config","empty-value"],"backgroundTag":"empty-required-field","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}