oven-sh/bun · error · FromPnpmLockfileError
InvalidPnpmLockfile
InvalidPnpmLockfile
Error message
InvalidPnpmLockfile
What it means
The pnpm-lock.yaml being imported could not be parsed as a valid pnpm lockfile (bad structure or unsupported format) during catalog conversion. It fires in FromPnpmLockfileError paths when the source document fails validation.
Solutions
- Ensure pnpm-lock.yaml is intact and generated by a supported pnpm version
- Regenerate it with pnpm if hand-edited or merge-conflicted
- Or delete it and let Bun resolve from package.json directly
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/install/lockfile/CatalogMap.rs:517 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/f496a7f52c82e075.
Report an issue: GitHub.
Appendix: source
Thrown at src/install/lockfile/CatalogMap.rs:517
let new_name = builder.append::<String>(catalog_name.slice(old_buf));
let buf = builder.string_bytes.as_slice();
new_catalog.groups.put_assume_capacity_context(
new_name,
new_group,
|k| ArrayHashAdapter::hash(&ctx(buf), k),
|a, b, i| ArrayHashAdapter::eql(&ctx(buf), a, b, i),
);
}
Ok(new_catalog)
}
}
#[derive(thiserror::Error, Debug, strum::IntoStaticStr)]
pub enum FromPnpmLockfileError {
#[error("OutOfMemory")]
OutOfMemory,
#[error("InvalidPnpmLockfile")]
InvalidPnpmLockfile,
}
bun_core::oom_from_alloc!(FromPnpmLockfileError);
fn put_entries_from_pnpm_lockfile(
catalog_map: &mut Map,
log: &mut Log,
entries_obj: &E::Object,
string_buf: &mut StringBuf,
) -> Result<(), FromPnpmLockfileError> {
for entry_prop in entries_obj.properties.slice() {
let key = entry_prop.key.as_ref().unwrap();
let value = entry_prop.value.as_ref().unwrap();
let Some(dep_name_str) = key.as_utf8_string_literal() else {
return Err(FromPnpmLockfileError::InvalidPnpmLockfile);
};
let dep_name_hash = StringBuilderNs::string_hash(dep_name_str);View on GitHub (pinned to 8c5296ac45)