oven-sh/bun · error · ParseUrlError

InvalidGitUrl

InvalidGitUrl

Error message

InvalidGitUrl

What it means

The parsed URL is not a valid git URL for HostedGitInfo extraction — it lacks the required host/user/project structure. It fires when ParseUrlError is returned because the input URL can't be decomposed into git repository components.

Solutions

  1. Verify the URL includes host, user/org, and repository path components
  2. Prefer canonical https://host/user/project URLs for git dependencies
  3. Check for typos in the specifier after `#` fragments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/install/hosted_git_info.rs:78 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/a4fb1e53ea6dc667. Report an issue: GitHub.

Appendix: source

Thrown at src/install/hosted_git_info.rs:78

use enum_map::{Enum, EnumMap};

// ──────────────────────────────────────────────────────────────────────────
// Errors
// ──────────────────────────────────────────────────────────────────────────

#[derive(thiserror::Error, Debug, Clone, Copy, PartialEq, Eq, strum::IntoStaticStr)]
pub enum HostedGitInfoError {
    #[error("OutOfMemory")]
    OutOfMemory,
    #[error("InvalidURL")]
    InvalidURL,
}

bun_core::oom_from_alloc!(HostedGitInfoError);

#[derive(thiserror::Error, Debug, Clone, Copy, PartialEq, Eq, strum::IntoStaticStr)]
pub enum ParseUrlError {
    #[error("InvalidGitUrl")]
    InvalidGitUrl,
    #[error("OutOfMemory")]
    OutOfMemory,
}

bun_core::oom_from_alloc!(ParseUrlError);

// ──────────────────────────────────────────────────────────────────────────
// Representation
// ──────────────────────────────────────────────────────────────────────────

/// Represents how a URL should be reported when formatting it as a string.
///
/// Input strings may be given in any format and they may be formatted in any format. If you wish
/// to format a URL in a specific format, you can use its `format*` methods. However, each input
/// string has a "default" representation which is used when calling `toString()`. Depending on the
/// input, the default representation may be different.
#[derive(Debug, Clone, Copy, PartialEq, Eq, strum::IntoStaticStr)]

View on GitHub (pinned to 8c5296ac45)