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] Yarn v2 - resolve package patching breaking change #897

Closed
1 task done
AlexandreBonaventure opened this issue Feb 4, 2020 · 2 comments · Fixed by #1464 or #3455
Closed
1 task done

[Bug] Yarn v2 - resolve package patching breaking change #897

AlexandreBonaventure opened this issue Feb 4, 2020 · 2 comments · Fixed by #1464 or #3455
Assignees
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@AlexandreBonaventure
Copy link
Contributor

AlexandreBonaventure commented Feb 4, 2020

  • I'd be willing to implement a fix

Describe the bug

As yarn v2 is now stable I took a shot at trying it on my current codebase. Some plugins that I use rely on resolve pkg (which ^1.9.0 is supported )
However, I'm noticing that yarn is changing the behaviour of the library, essentially it is not transparently patching the resolve pkg and breaks code that is working outside of yarn

To Reproduce
https://github.com/AlexandreBonaventure/yarn-berry-resolve-repro

  1. git clone https://github.com/AlexandreBonaventure/yarn-berry-resolve-repro && cd yarn-berry-resolve-repro && yarn
    2a. node index.js SUCCESSFULLY RESOLVE
    2b. yarn node index.js ERROR

Screenshots

Image

Environment

  • OS: OSX 10.15.2
  • Node version 11.12.0
  • Yarn version 2.0.0-rc28
@AlexandreBonaventure AlexandreBonaventure added the bug Something isn't working label Feb 4, 2020
@AlexandreBonaventure AlexandreBonaventure changed the title [Bug] [Bug] Yarn v2 - resolve package patching breaking change Feb 4, 2020
@AlexandreBonaventure
Copy link
Contributor Author

After digging in source code I understand that the breaking change is introduced here :

opts.paths = function (request, basedir, getNodeModulePaths, opts) {

where paths option is being completely overriden by pnp patch. One solution could be to smartly merge in the input paths option instead of staright up replacing it

@yarnbot
Copy link
Collaborator

yarnbot commented Jun 9, 2020

Hi! 👋

This issue looks stale, and doesn't feature the reproducible label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).

Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolution faster). It helps us help you! 😃

If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded label.

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
4 participants