{"record":{"id":"54f5c44d3aada4f8","repo":"BoundaryML/baml","slug":"path-missing-package-table-add-package-name-your-project","errorCode":null,"errorMessage":"{path}: missing `[package]` table.\nAdd:\n\n    [package]\n    name = \"<your-project-name>\"\n","messagePattern":"(.+?): missing `\\[package\\]` table\\.\nAdd:\n\n    \\[package\\]\n    name = \"<your-project-name>\"\n","errorType":"validation","errorClass":"ManifestError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_db/src/manifest.rs","lineNumber":183,"sourceCode":"    pub sdk_import_path: Option<Spanned<String>>,\n\n    /// Maximum non-null union arity represented as a closed generated Go\n    /// union. Larger unions use `any`. Go-only; defaults to 3.\n    pub max_typed_union_arity: Option<Spanned<i64>>,\n\n    #[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","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_db/src/manifest.rs#L165-L201","documentation":"A `ManifestError` variant from manifest parsing (`toml::from_str` path in manifest.rs). The project manifest TOML parsed but has no `[package]` table, so the manifest has no package identity at all. The error message includes the file path and a snippet showing what to add.","triggerScenarios":"Loading a `baml.toml` (project manifest) that lacks a `[package]` section, e.g. an empty file or one containing only other tables.","commonSituations":"Freshly created, empty, or copied config files; deleting the `[package]` table while cleaning up; confusing a project manifest with another config file format.","solutions":["Add a `[package]` table with a `name` key to the manifest at the reported path.","If the file is not meant to be a project manifest, remove or rename it so it isn't picked up.","Verify you are loading the intended manifest file path."],"exampleFix":"// before (baml.toml)\n# empty\n// after (baml.toml)\n[package]\nname = \"my-project\"","handlingStrategy":"try-catch","validationCode":"fn manifest_has_package_table(raw: &str) -> bool {\n    raw.parse::<toml::Value>().map(|v| v.get(\"package\").is_some()).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match load_manifest(path) {\n    Err(ManifestError::MissingPackageTable { path }) => eprintln!(\"{path:?}: add a [package] table with a name\"),\n    Err(e) => eprintln!(\"manifest error: {e}\"),\n    Ok(m) => m,\n}","preventionTips":["Never ship a baml.toml without a [package] table.","Validate the manifest in CI before running the compiler.","Keep project manifests distinct from other config files."],"tags":["toml","manifest","config","rust"],"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-14T11:17:12.474Z"}