{"record":{"id":"05b70ffa96b53723","repo":"oven-sh/bun","slug":"lazypackagedestinationdir-is-closed-this-should-n","errorCode":null,"errorMessage":"LazyPackageDestinationDir is closed! This should never happen. Why did this happen?! It's not your fault. Its our fault. We're sorry.","messagePattern":"LazyPackageDestinationDir is closed! This should never happen\\. Why did this happen\\?! It's not your fault\\. Its our fault\\. We're sorry\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/install/PackageInstaller.rs","lineNumber":394,"sourceCode":"}\n\nimpl<'a> LazyPackageDestinationDir<'a> {\n    #[allow(dead_code)]\n    pub(crate) fn get_dir(&mut self) -> crate::Result<Fd> {\n        match self {\n            LazyPackageDestinationDir::Dir(fd) => Ok(*fd),\n            LazyPackageDestinationDir::Owned(dir) => Ok(dir.fd()),\n            LazyPackageDestinationDir::NodeModulesPath {\n                node_modules,\n                root_node_modules_dir,\n            } => {\n                let dir = node_modules.open_dir(Dir::borrow(root_node_modules_dir))?;\n                let fd = dir.fd();\n                *self = LazyPackageDestinationDir::Owned(dir);\n                Ok(fd)\n            }\n            LazyPackageDestinationDir::Closed => {\n                panic!(\n                    \"LazyPackageDestinationDir is closed! This should never happen. Why did this happen?! It's not your fault. Its our fault. We're sorry.\"\n                )\n            }\n        }\n    }\n\n    fn close(&mut self) {\n        *self = LazyPackageDestinationDir::Closed;\n    }\n}\n\n/// A dependency alias becomes the install destination inside `node_modules`\n/// (the existing entry is renamed aside, deleted, and re-created). Reject\n/// anything that could escape `node_modules`: empty names, `.`/`..`\n/// components, absolute paths, drive letters, backslashes, NUL bytes, and any\n/// separator other than the single `/` in a scoped name (`@scope/name`).\npub(crate) fn alias_is_safe_install_target(alias: &[u8]) -> bool {\n    if alias.is_empty() || alias.len() >= MAX_PATH_BYTES || strings::contains_any(alias, b\"\\\\:\\0\") {","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/src/install/PackageInstaller.rs#L376-L412","documentation":"Error \"LazyPackageDestinationDir is closed! This should never happen. Why did this happen?! It's not your fault. Its our fault. We're sorry.\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at src/install/PackageInstaller.rs:394 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"}