oven-sh/bun · error

Patched dependency cache dir subpath does not have the "_pat

Error message

Patched dependency cache dir subpath does not have the "_patch_hash=HASH" suffix. This is a bug, please file a GitHub issue.

What it means

Error "Patched dependency cache dir subpath does not have the "_patch_hash=HASH" suffix. This is a bug, please file a GitHub issue." thrown in oven-sh/bun.

Source

Thrown at src/install/PackageInstall.rs:2265

        manager: &mut PackageManager,
        package_id: PackageID,
        resolution_tag: resolution::Tag,
    ) -> bool {
        let state = manager.get_preinstall_state(package_id);
        match state {
            crate::PreinstallState::Done => false,
            _ => {
                let exists = if self.patch.is_none() {
                    crate::package_manager::directories::is_package_in_cache_at(
                        self.cache_dir,
                        self.cache_dir_subpath,
                        resolution_tag,
                    )
                } else {
                    let idx =
                        strings::last_index_of(self.cache_dir_subpath.as_bytes(), b"_patch_hash=")
                            .unwrap_or_else(|| {
                                panic!("Patched dependency cache dir subpath does not have the \"_patch_hash=HASH\" suffix. This is a bug, please file a GitHub issue.")
                            });
                    let non_patched =
                        bun_core::ZBox::from_bytes(&self.cache_dir_subpath.as_bytes()[..idx]);
                    crate::package_manager::directories::is_package_in_cache_at(
                        self.cache_dir,
                        &non_patched,
                        resolution_tag,
                    )
                };
                if exists {
                    manager.set_preinstall_state(package_id, crate::PreinstallState::Done);
                }
                !exists
            }
        }
    }

    pub(crate) fn patched_package_missing_from_cache(

View on GitHub (pinned to 8c5296ac45)

When it happens

Trigger: Thrown at src/install/PackageInstall.rs:2265 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/1ab2cb46c7a2cfbe. Report an issue: GitHub.