Files
Ishan Gupta d3a0765bea fix(dependencies-hierarchy): handle undefined pkgSnapshot in pnpm why -r (#10705)
* fix(dependencies-hierarchy): handle undefined pkgSnapshot in pnpm why -r

Running pnpm why -r crashes with TypeError due to undefined pkgSnapshot during
invokation of pkgSnapshotToResolution.

This commit wraps resolution and integrity steps with if (pkgSnapshot).
Also, added unit test for the same.

close #10700

* fix: handle undefined pkgSnapshot in pnpm why -r

* Apply suggestions from code review

#10700

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-27 17:28:55 +01:00
..