Skip to content

fix(lockfile): tolerate non-string pnpm engines values#419

Open
pullfrog[bot] wants to merge 1 commit into
mainfrom
pullfrog/417-pnpm-engines-nested-map
Open

fix(lockfile): tolerate non-string pnpm engines values#419
pullfrog[bot] wants to merge 1 commit into
mainfrom
pullfrog/417-pnpm-engines-nested-map

Conversation

@pullfrog

@pullfrog pullfrog Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What

nub install failed to parse a pnpm-lock.yaml when a package's engines map carried a non-string value:

ERR_NUB_MANIFEST_PARSE
  × failed to parse lockfile
  ╰─▶ ... packages.cordova-plugin-inappbrowser@6.0.0.engines.cordovaDependencies:
      invalid type: map, expected a string at line 3926 column 36

cordova-plugin-inappbrowser@6.0.0 ships engines.cordovaDependencies as a nested map, which pnpm preserves verbatim in the lockfile. The pnpm lockfile parser deserialized engines as a strict BTreeMap<String, String>, so the nested-map value tripped the whole parse and failed the install.

Fix

Apply aube_manifest::engines_tolerant to the pnpm parser's engines field — the same deserializer the npm lockfile parser already uses for the analogous array-shaped legacy case. It keeps ordinary string ranges (node, npm) and drops non-string entries. The fix covers both pnpm parse paths (the whole-file serde path and the subset-scanner fallback), since both funnel package bodies through the same RawPackageInfo struct.

A dropped nested value won't survive a subsequent lockfile re-write — the same accepted tradeoff npm's parser already makes, and aube never consumes those values.

Test

Added parse_package_engines_tolerates_nested_map_values, a regression test built from the reported shape that asserts the ordinary node range survives and the nested-map cordovaDependencies entry is dropped. Fails before the fix, passes after. All 144 pnpm lockfile tests pass.

Closes #417

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

A package's engines map can carry a non-string value (e.g.
cordova-plugin-inappbrowser ships engines.cordovaDependencies as a
nested map, which pnpm preserves verbatim in pnpm-lock.yaml). The pnpm
lockfile parser deserialized engines as a strict BTreeMap<String,
String> and failed the whole install with ERR_NUB_MANIFEST_PARSE.

Apply aube_manifest::engines_tolerant, the same deserializer the npm
lockfile parser already uses for the analogous array-shaped case: keep
string ranges, drop non-string entries.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nub Ready Ready Preview, Comment Jul 10, 2026 12:46pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nub install fails with pnpm-lock.yaml

0 participants