Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Percy does not work with Yarn PnP #1612

Open
wojtekmaj opened this issue Jun 6, 2024 · 2 comments
Open

Percy does not work with Yarn PnP #1612

wojtekmaj opened this issue Jun 6, 2024 · 2 comments
Labels
✨ enhancement New feature or request

Comments

@wojtekmaj
Copy link

wojtekmaj commented Jun 6, 2024

The problem

[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.

Required package: @percy/client (via "@percy/client/utils")
Required by: @percy/cli-exec@npm:1.28.7 (via /Users/wmaj/.yarn/berry/cache/@percy-cli-exec-npm-1.28.7-55645a8ef5-10c0.zip/node_modules/@percy/cli-exec/dist/exec.js)

…followed by a couple more similar errors.

Environment

  • Node version: 22.0.0
  • @percy/cli version: 1.28.7
  • Version of Percy SDK you’re using: ?
  • If needed, a build or snapshot ID: ?
  • OS version: macOS 14.5 (23F79)
  • Type of shell command-line [interface]: zsh

Details

The error described above appears when percy exec command is attempted from Yarn Plug'n'Play, which is treating wrong/missing dependencies more strictly than other package managers. While this error appears on Yarn only, it signifies a deeper issue that other users of other package managers might encounter.

Adding the following to yarnrc.yml:

packageExtensions:
  '@percy/cli-exec@*':
    dependencies:
      '@percy/client': '*'
  '@percy/playwright@*':
    dependencies:
      '@percy/sdk-utils': '*'
    peerDependencies:
      playwright: '*'

fixes the issue, but it shouldn't be necessary.

@wojtekmaj wojtekmaj changed the title Percy exec does not work with Yarn PnP Percy does not work with Yarn PnP Jun 6, 2024
@prklm10
Copy link
Contributor

prklm10 commented Jun 11, 2024

Hi @wojtekmaj thanks for raising this, we will take this as a feature request and get back to you. There is no ETA for this as of now.

@prklm10 prklm10 added the ✨ enhancement New feature or request label Jun 11, 2024
@skribbz14
Copy link

packageExtensions:
  '@percy/cli-exec@*':
    dependencies:
      '@percy/client': '*'
  '@percy/playwright@*':
    dependencies:
      '@percy/sdk-utils': '*'
    peerDependencies:
      playwright: '*'

In order for the above code to work in my project I needed to specify the exact version numbers, instead of "*".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants