BoundaryML/baml · error · ManifestError

{path}: missing `[package]` table. Add: [package] n

Error message

{path}: missing `[package]` table.
Add:

    [package]
    name = "<your-project-name>"

What it means

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.

Source

Thrown at baml_language/crates/baml_db/src/manifest.rs:183

    pub sdk_import_path: Option<Spanned<String>>,

    /// Maximum non-null union arity represented as a closed generated Go
    /// union. Larger unions use `any`. Go-only; defaults to 3.
    pub max_typed_union_arity: Option<Spanned<i64>>,

    #[serde(flatten)]
    pub unknown: IndexMap<String, toml::Value>,
}

/// Parse `baml.toml` text into the typed manifest.
pub fn parse(content: &str) -> Result<BamlToml, toml::de::Error> {
    toml::from_str(content)
}

/// Why a manifest's `[package].name` could not be resolved.
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum ManifestError {
    #[error(
        "{path}: missing `[package]` table.\nAdd:\n\n    [package]\n    name = \"<your-project-name>\"\n"
    )]
    MissingPackageTable { path: std::path::PathBuf },
    #[error("{path}: `[package]` is missing `name = \"<your-project-name>\"`.")]
    MissingPackageName { path: std::path::PathBuf },
    #[error("{path}: `[package].name` cannot be empty.")]
    EmptyPackageName { path: std::path::PathBuf },
    #[error(
        "{path}: `[dependencies]` is not supported in a project manifest yet: package imports are \
         pending a design pass. Remove the table; a project reaches the standard library implicitly."
    )]
    DependenciesUnsupported { path: std::path::PathBuf },
    #[error(
        "{path}: `[package].prelude` is reserved for the standard library's own manifests. Remove it."
    )]
    PreludeUnsupported { path: std::path::PathBuf },
}

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Add a `[package]` table with a `name` key to the manifest at the reported path.
  2. If the file is not meant to be a project manifest, remove or rename it so it isn't picked up.
  3. Verify you are loading the intended manifest file path.

Example fix

// before (baml.toml)
# empty
// after (baml.toml)
[package]
name = "my-project"
Defensive patterns

Strategy: try-catch

Validate before calling

fn manifest_has_package_table(raw: &str) -> bool {
    raw.parse::<toml::Value>().map(|v| v.get("package").is_some()).unwrap_or(false)
}

Try / catch

match load_manifest(path) {
    Err(ManifestError::MissingPackageTable { path }) => eprintln!("{path:?}: add a [package] table with a name"),
    Err(e) => eprintln!("manifest error: {e}"),
    Ok(m) => m,
}

Prevention

When it happens

Trigger: Loading a `baml.toml` (project manifest) that lacks a `[package]` section, e.g. an empty file or one containing only other tables.

Common situations: Freshly created, empty, or copied config files; deleting the `[package]` table while cleaning up; confusing a project manifest with another config file format.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/54f5c44d3aada4f8. Report an issue: GitHub.