Skip to content

fix: don't silently skip an optional dependency if it cannot be resolved from a mature version - #10289

Merged
zkochan merged 2 commits into
mainfrom
fix/10270
Dec 8, 2025
Merged

zkochan merged 2 commits into
mainfrom
fix/10270

Conversation

@zkochan

@zkochan zkochan commented Dec 8, 2025

Copy link
Copy Markdown
Member

close #10270

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where optional dependencies were being silently skipped when they couldn't be resolved due to minimumReleaseAge settings, which is a security/policy configuration. The fix introduces a new error code ERR_PNPM_NO_MATURE_MATCHING_VERSION to distinguish maturity-related resolution failures from general resolution failures, ensuring users are properly notified when maturity policies prevent dependency resolution.

Key Changes

  • Introduced ERR_PNPM_NO_MATURE_MATCHING_VERSION error code to distinguish maturity constraint failures from general resolution failures
  • Updated optional dependency error handling to exclude the new error code from silent skipping
  • Maintained consistent error reporting for both old and new error codes

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
resolving/npm-resolver/src/index.ts Modified NoMatchingVersionError constructor to conditionally use the new error code when publishedBy is set
pkg-manager/resolve-dependencies/src/resolveDependencies.ts Added ERR_PNPM_NO_MATURE_MATCHING_VERSION to the list of error codes that should not be silently skipped for optional dependencies
reviewing/outdated/src/createManifestGetter.ts Updated error handling to catch the new error code when checking for outdated packages with maturity constraints
cli/default-reporter/src/reportError.ts Added case for the new error code to use the same error formatting as the original error code
.changeset/flat-clowns-type.md Documents the breaking change in @pnpm/npm-resolver with a major version bump
.changeset/fair-nights-grow.md Documents the bug fix across multiple affected packages with patch version bumps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .changeset/fair-nights-grow.md Resolved
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.

minimumReleaseAge silently dropping optionalDependencies not passing the age criteria

2 participants