Skip to content

fix(cli): don't panic in tauri info on unparseable Node.js package versions - #16058

Open
Raaif-Yousuf wants to merge 1 commit into
tauri-apps:devfrom
Raaif-Yousuf:fix/tauri-info-pnpm-version-panic
Open

Raaif-Yousuf wants to merge 1 commit into
tauri-apps:devfrom
Raaif-Yousuf:fix/tauri-info-pnpm-version-panic

Conversation

@Raaif-Yousuf

Copy link
Copy Markdown

Closes #16033

tauri info builds the "(outdated, latest: ...)" hint by calling semver::Version::parse(..).unwrap() on the installed version. For pnpm, that version comes from running a regex over pnpm list --parseable. With a peer-suffixed store directory like @tauri-apps+plugin-http@2.6_3b0f9b4c..., the _ ends the match and the captured version is 2.6, so the unwrap panics and tauri info aborts.

I moved the suffix logic into a small outdated_suffix helper. It returns no hint when either version doesn't parse, so the command no longer panics. The package is still listed with whatever version was detected. This PR doesn't change how the version is extracted from the pnpm path.

  • Added unit tests for empty, unparseable (2.6), outdated, and up-to-date versions
  • Added .changes/fix-cli-info-pnpm-version-panic.md (patch:bug for tauri-cli and @tauri-apps/cli)
  • cargo test -p tauri-cli (63 unit + 1 integration passed), cargo clippy -p tauri-cli --all-targets and cargo fmt --check are clean

…versions

`nodejs_section_item` unwrapped `semver::Version::parse` on the installed
version to build the "(outdated, latest: ...)" hint. That version is scraped
from package manager output and isn't always valid semver: for pnpm
peer-suffixed store directories like `@tauri-apps+plugin-http@2.6_<hash>`
the regex captures `2.6`, and `tauri info` panics.

Move the suffix into `outdated_suffix`, which returns no suffix when either
version fails to parse.

Closes tauri-apps#16033
@Raaif-Yousuf
Raaif-Yousuf requested a review from a team as a code owner September 19, 2026 20:03

This branch has not been deployed

No deployments
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.

tauri info panics with "unexpected end of input while parsing minor version number" on pnpm peer-suffixed paths

1 participant