{"record":{"id":"1ab2cb46c7a2cfbe","repo":"oven-sh/bun","slug":"patched-dependency-cache-dir-subpath-does-not-have","errorCode":null,"errorMessage":"Patched dependency cache dir subpath does not have the \"_patch_hash=HASH\" suffix. This is a bug, please file a GitHub issue.","messagePattern":"Patched dependency cache dir subpath does not have the \"_patch_hash=HASH\" suffix\\. This is a bug, please file a GitHub issue\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/install/PackageInstall.rs","lineNumber":2265,"sourceCode":"        manager: &mut PackageManager,\n        package_id: PackageID,\n        resolution_tag: resolution::Tag,\n    ) -> bool {\n        let state = manager.get_preinstall_state(package_id);\n        match state {\n            crate::PreinstallState::Done => false,\n            _ => {\n                let exists = if self.patch.is_none() {\n                    crate::package_manager::directories::is_package_in_cache_at(\n                        self.cache_dir,\n                        self.cache_dir_subpath,\n                        resolution_tag,\n                    )\n                } else {\n                    let idx =\n                        strings::last_index_of(self.cache_dir_subpath.as_bytes(), b\"_patch_hash=\")\n                            .unwrap_or_else(|| {\n                                panic!(\"Patched dependency cache dir subpath does not have the \\\"_patch_hash=HASH\\\" suffix. This is a bug, please file a GitHub issue.\")\n                            });\n                    let non_patched =\n                        bun_core::ZBox::from_bytes(&self.cache_dir_subpath.as_bytes()[..idx]);\n                    crate::package_manager::directories::is_package_in_cache_at(\n                        self.cache_dir,\n                        &non_patched,\n                        resolution_tag,\n                    )\n                };\n                if exists {\n                    manager.set_preinstall_state(package_id, crate::PreinstallState::Done);\n                }\n                !exists\n            }\n        }\n    }\n\n    pub(crate) fn patched_package_missing_from_cache(","sourceCodeStart":2247,"sourceCodeEnd":2283,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/PackageInstall.rs#L2247-L2283","documentation":"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.","triggerScenarios":"Thrown at src/install/PackageInstall.rs:2265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}