Skip to content

fix: Declare missing @percy/client dependency in cli-exec for Yarn PnP#2154

Open
akshayminocha5 wants to merge 1 commit intomasterfrom
fix/yarn-pnp-undeclared-deps
Open

fix: Declare missing @percy/client dependency in cli-exec for Yarn PnP#2154
akshayminocha5 wants to merge 1 commit intomasterfrom
fix/yarn-pnp-undeclared-deps

Conversation

@akshayminocha5
Copy link
Contributor

Summary

  • Adds @percy/client as a declared dependency in @percy/cli-exec/package.json — it was already imported (waitForTimeout from @percy/client/utils) but not declared, breaking Yarn PnP strict resolution
  • Removes unused @percy/sdk-utils from @percy/monitoring/package.json — declared but never imported in any source file

Root Cause

Yarn workspaces hoist dependencies to the root node_modules, so the missing declaration worked in traditional npm/yarn. Yarn PnP enforces strict resolution where each package can only see its own declared dependencies, causing:

[percy] Error: @percy/cli-exec tried to access @percy/client, but it isn't declared
in its dependencies; this makes the require call ambiguous and unsound.

Testing

  • @percy/cli-exec tests: 33/33 pass
  • @percy/monitoring tests: 40/40 pass
  • Full monorepo audit confirmed this is the only undeclared cross-package dependency

Post-Deploy Monitoring & Validation

No additional operational monitoring required: this is a package.json metadata-only change with no runtime behavior change — it makes an already-used dependency explicitly declared.

Closes #1612


Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@percy/cli-exec imports @percy/client/utils (waitForTimeout) but did not
declare @percy/client as a dependency. This breaks Yarn PnP which enforces
strict dependency resolution. Also removes unused @percy/sdk-utils from
@percy/monitoring.

Closes #1612

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@akshayminocha5 akshayminocha5 requested a review from a team as a code owner March 17, 2026 10:49
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.

Percy does not work with Yarn PnP

2 participants