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

[Bug?]: Incorrect ancestor breaking the chain report with PnP and undeclared dependency #3925

Open
1 task
Andarist opened this issue Dec 28, 2021 · 2 comments
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@Andarist
Copy link
Contributor

Self-service

  • I'd be willing to implement a fix

Describe the bug

I'm unsure if this is an actual bug but for me, as a user, the printed error is confusing and @merceyz has suggested that this looks awfully similar to a bug already fixed in #2915

I was testing if some Emotion packages are PnP-compatible as I had a strong suspicion that they aren't (and after my investigation, I've prepared this PR to fix the issue). After confirming the problem I've attempted to fix this in the created workspace using packageExtensions and I've declared @emotion/babel-plugin as @emotion/styled's peer dep:
https://github.com/Andarist/berry-ancestor-breaking-chain-repro/blob/525c3b165f624039a41c27a47235a8302b855fbb/.yarnrc.yml#L10-L12
but this was actually not needed because it was already declared as its dependency:
https://github.com/emotion-js/emotion/blob/4efa2cb3f45456bc793fb7b7f4d2382d9742cc35/packages/styled/package.json#L15

And according to @merceyz this likely shouldn't be reported as an error as per:

[...] Note that peer dependencies can also be listed as regular dependencies; in this case, Yarn will use the package provided by the ancestors if possible, but will fallback to the regular dependencies otherwise
https://yarnpkg.com/configuration/manifest#peerDependencies

Note that the reason why this setup~ is the problem in the first place is that I've forgotten to install @emotion/babel-plugin in the workspace itself.

To reproduce

git clone git@github.com:Andarist/berry-ancestor-breaking-chain-repro.git && cd berry-ancestor-breaking-chain-repro && yarn && yarn start

Environment

System:
    OS: macOS Mojave 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-6920HQ CPU @ 2.90GHz
  Binaries:
    Node: 14.16.1 - /private/var/folders/ws/tlwxqvs5407f21nxy7w8bgr80000gp/T/xfs-8034a477/node
    Yarn: 3.1.1 - /private/var/folders/ws/tlwxqvs5407f21nxy7w8bgr80000gp/T/xfs-8034a477/yarn
    npm: 8.2.0 - ~/.nvm/versions/node/v14.16.1/bin/npm

Additional context

No response

@Andarist Andarist added the bug Something isn't working label Dec 28, 2021
@merceyz merceyz added the upholded Real issues without formal reproduction label Jan 19, 2022
@gruckion
Copy link

Did you ever get to the bottom of this the bugs been open for a year @Andarist

@tomsaleeba
Copy link

If you have this error message and just wanna fix it (and didn't follow the link in the original post 😬), the fix from this comment worked for me (copied from link, but adapt to your trouble-making packages):

# .yarnrc.yml

packageExtensions:
  "@react-spring/web@*":
    dependencies:
      react-dom: "*"

Link to offical packageExtensions docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upholded Real issues without formal reproduction
Projects
None yet
Development

No branches or pull requests

4 participants