{"record":{"id":"fa73f6e7f38daca6","repo":"denoland/deno","slug":"missing-index","errorCode":null,"errorMessage":"missing index '{}'","messagePattern":"missing index '(.+?)'","errorType":"exception","errorClass":"ParseError","httpStatus":null,"severity":"error","filePath":"libs/eszip/v2.rs","lineNumber":1785,"sourceCode":"  let mut pkg_index_to_pkg_id = HashMap::with_capacity(packages.len());\n  for (i, pkg) in packages.iter().enumerate() {\n    let id = NpmPackageId::from_serialized(&pkg.name).map_err(|err| {\n      ParseError::InvalidV2NpmPackage(pkg.name.clone(), err.into())\n    })?;\n    pkg_index_to_pkg_id.insert(EszipNpmPackageIndex(i as u32), id);\n  }\n  let mut final_packages = Vec::with_capacity(packages.len());\n  for (i, pkg) in packages.into_iter().enumerate() {\n    let eszip_id = EszipNpmPackageIndex(i as u32);\n    let id = pkg_index_to_pkg_id.get(&eszip_id).unwrap();\n    let mut dependencies = HashMap::with_capacity(pkg.dependencies.len());\n    for (key, pkg_index) in pkg.dependencies {\n      let id = match pkg_index_to_pkg_id.get(&pkg_index) {\n        Some(id) => id,\n        None => {\n          return Err(ParseError::InvalidV2NpmPackage(\n            pkg.name,\n            anyhow::anyhow!(\"missing index '{}'\", pkg_index.0),\n          ));\n        }\n      };\n      dependencies.insert(StackString::from_string(key), id.clone());\n    }\n    final_packages.push(SerializedNpmResolutionSnapshotPackage {\n      id: id.clone(),\n      system: Default::default(),\n      dist: Default::default(),\n      dependencies,\n      optional_dependencies: Default::default(),\n      extra: Default::default(),\n      is_deprecated: false,\n      has_bin: false,\n      has_scripts: false,\n      optional_peer_dependencies: Default::default(),\n    });\n  }","sourceCodeStart":1767,"sourceCodeEnd":1803,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/libs/eszip/v2.rs#L1767-L1803","documentation":"While parsing the npm-packages section of an eszip v2 archive, a package dependency referenced an EszipNpmPackageIndex that does not exist in the archive's package index table. The archive is internally inconsistent; the error is wrapped in ParseError::InvalidV2NpmPackage together with the package name.","triggerScenarios":"Running EszipV2::parse on a truncated, corrupted, or hand-modified archive; archives written by an eszip version whose index layout differs from the reader's.","commonSituations":"Partially downloaded or copied compiled binaries; corrupted CI cache layers; compile artifacts produced and consumed by different Deno/eszip versions after a format change.","solutions":["Regenerate or re-download the eszip/compiled binary from its original source","Verify integrity (checksum/size) at transfer boundaries such as artifact stores and caches","Pin producer and consumer to the same Deno/eszip version when generating archives programmatically"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# verify the artifact before parsing it\nsha256sum -c compiled.bin.sha256","typeGuard":null,"tryCatchPattern":"match EszipV2::parse(reader) {\n  Err(ParseError::InvalidV2NpmPackage(name, e)) => {\n    // archive is internally inconsistent: re-download or rebuild it\n    rebuild_artifact(&name)\n  }\n  result => result?,\n}","preventionTips":["Checksum compiled binaries at transfer boundaries (artifact stores, caches)","Regenerate artifacts instead of patching them by hand","Pin producer and consumer Deno/eszip versions in CI matrices"],"tags":["eszip","npm","parsing","corruption","archive"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}