You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(pnpm): direct optionalDependencies in importers are marked as dev #11434
In pnpm v9 lockfiles, packages from optionalDependencies of a project get Dev: true. The same happens to packages that are only reachable through them. Trivy skips dev dependencies by default, so these packages and their vulnerabilities are missing from scan results.
pnpm installs optional dependencies in production and skips only devDependencies.
The v9 parser reads only dependencies and devDependencies from importers. Lockfile v6 is not affected because Trivy uses the dev flag of each package there.
I can take this one. The v9 parser reads only dependencies and devDependencies from the importers section, so anything installed via optionalDependencies never gets seeded as a production dep and defaults to Dev=true downstream (along with everything only reachable through it). I will add optionalDependencies to the Importer type and mark those as production, with a fixture-based test. PR incoming.
Withdrawing my claim above: I missed that #11428 (opened Oct 17) already implements this exact fix for the v9 importer optionalDependencies parsing. No duplicate work from me, will leave this one to that PR.
Activity
Varshith-Kali commentedon Oct 19, 2026
I can take this one. The v9 parser reads only dependencies and devDependencies from the importers section, so anything installed via optionalDependencies never gets seeded as a production dep and defaults to Dev=true downstream (along with everything only reachable through it). I will add optionalDependencies to the Importer type and mark those as production, with a fixture-based test. PR incoming.
drawliin commentedon Oct 19, 2026
@Varshith-Kali it's already solved #11428
Varshith-Kali commentedon Oct 19, 2026
Withdrawing my claim above: I missed that #11428 (opened Oct 17) already implements this exact fix for the v9 importer optionalDependencies parsing. No duplicate work from me, will leave this one to that PR.