oven-sh/bun · error

Cannot move an empty Result. This is a bug in Bun. Please re

Error message

Cannot move an empty Result. This is a bug in Bun. Please report this issue on GitHub.

What it means

Error "Cannot move an empty Result. This is a bug in Bun. Please report this issue on GitHub." thrown in oven-sh/bun.

Source

Thrown at src/install/hosted_git_info.rs:1013

// Uses `Range<usize>` into `_owned_buffer` rather than self-referential
// slices (see the HostedGitInfo struct-level note).
pub(crate) struct ExtractResult {
    pub(crate) user: Option<Range<usize>>,
    pub(crate) project: Range<usize>,
    pub(crate) committish: Option<Range<usize>>,
    _owned_buffer: Option<Box<[u8]>>,
}

impl ExtractResult {
    /// Return the buffer which owns this Result and the allocator responsible for
    /// freeing it.
    ///
    /// Same semantics as C++ STL. Safe-to-deinit Result after this, not safe to
    /// use it.
    fn move_out(&mut self) -> Box<[u8]> {
        let Some(buffer) = self._owned_buffer.take() else {
            panic!(
                "Cannot move an empty Result. This is a bug in Bun. Please \
                 report this issue on GitHub."
            );
        };
        buffer
    }
}

/// Encapsulates all the various foramtters that different hosts may have. Usually this has
/// to do with URLs, but could be other things.
pub(crate) mod formatters {
    use super::*;

    /// Mirrors hosts.js's extract function
    pub(crate) mod extract {
        use super::*;

        pub(crate) type Type =

View on GitHub (pinned to 8c5296ac45)

When it happens

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