oven-sh/bun · error · bunfig::Error

Invalid Bunfig

Error message

Invalid Bunfig

What it means

Sentinel for an invalid bunfig.toml: the config file failed schema validation or semantic checks, so bunfig loading aborts. Parse errors from the TOML/JSON parser and OOM are surfaced via the wrapped variants instead.

Solutions

  1. Fix the invalid key/value in bunfig.toml indicated by surrounding diagnostics
  2. Compare your config against the documented bunfig schema for your Bun version
  3. Temporarily rename the file to confirm it is the source of the failure
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/bunfig/error.rs:3 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/3c63bff94ce52cb9. Report an issue: GitHub.

Appendix: source

Thrown at src/bunfig/error.rs:3

#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
pub enum Error {
    #[error("Invalid Bunfig")]
    InvalidBunfig,

    #[error(transparent)]
    Alloc(#[from] bun_alloc::AllocError),

    #[error(transparent)]
    Parse(#[from] bun_parsers::Error),
}

impl Error {
    #[allow(clippy::trivially_copy_pass_by_ref)]
    pub fn name(&self) -> &'static str {
        match self {
            Self::InvalidBunfig => "Invalid Bunfig",
            Self::Alloc(_) => "OutOfMemory",
            Self::Parse(e) => e.name(),
        }
    }

View on GitHub (pinned to 8c5296ac45)