oven-sh/bun · error

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

Error message

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

What it means

Internal invariant failure: code attempted to move out an ExtractResult that was empty (already moved or never populated), detected by the move_out guard. This indicates a Bun bug, not user error — hence the report-request message.

Solutions

  1. Update Bun — this is an internal bug fixed over time
  2. Report the reproduction (dependency specifiers used) to Bun's GitHub issues
  3. Work around by using a different URL form for the git dependency
Defensive patterns

Strategy: try-catch

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.

Appendix: 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)