-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
yarn 2 / Plug N Play Support #2386
Comments
Angular appears not to be supporting PNP yet. Tracking angular/angular-cli#12465 |
According to this angular-cli comment this is no longer exactly the case. It looks like native PnP mode support is not in yet, but @yarnpkg/pnpify or the node-modules linker strategy should (allegedly) be usable now. Of course, I have no idea what this means for you guys, maybe this doesn't help you, but it's a thing now. |
@ElbowBaggins CLI still now working. getting command nx not found |
this issue is now relating to nx cli i believe |
I am seeing the same issue here and disappointed NX CLI is breaking builds on yarn2 given it is now at version 2.1. Our project fails to build with default yarn2 settings, i.e.
Looks like this does indeed relate to the Is it possible to get a fix for this any time soon? |
Its annoying me now but im too ill to look. Ill carry on soon but they appears to be loads of files referencing direct file path grrr |
@FrozenPandaz @bekos what's the current status of Yarn v2 PnP support? |
Is still in Progress |
@derHodrig this is internal of NX thats the issue atm |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
This is still of interest for ongoing projects |
It looks like this step was solved in #3709 Is there a checklist of any other known current issues besides references to the string |
We've been running an Nx repo with Yarn v2 PNP on loose mode for a few months now, and so far most things have worked for us. The biggest exception is the I would assume the migrate latest script's problem stem from something either not declaring a dependency correctly, or there being a string referencing a node_modules path. I'm just not sure which out of the above ~79 it might be. |
@KyleBastien I wonder how you made it work in loose mode, I've added command: error:
|
Note: All of the You can fix this by utilizing
Note: These should probably be added to the package.json's of the respective |
Thank you, trying it out, although I agree that we should not have to do this |
@KyleBastien You mentioned "switch", what exactly do you mean? I assume setting |
@marckassay Here's the steps I follow to get this to work:
|
Yarn 3 is already available... |
To be clear, as I understand it, Nx absolutely supports Yarn 2+, just not PnP mode. PnP is one of the main developments in Yarn 2, but the traditional It would be fantastic to have PnP support in Nx, but it's not as dire as only supporting Yarn 1, which as @tyteen4a03 says is no longer in active development. |
@Peeja I struggled to get Yarn2 to work even in node linking mode. |
@tyteen4a03 Ah, that seems more concerning. I haven't tried myself in some time, so I was going by the comments above. But I wonder if conflating the issues is part of what keeps this from moving forward. |
iirc yarn2 with node modules linker should absolutely work at this point. If anyone is actively experiencing issues in latest please open a new report. |
When getting used to the zero-installs workflow with Yarn PnP, switching back to |
Is there any roadmap on the work required to implement this feature? |
Apparently not. |
FYI |
@vire when you say, it worked for you with yarn2, do you mean the Plug N Play version or the node_modules version? |
Plug'n'Play version, without |
So after reading through this, I assume that the conclusion is, Yarn PnP is not supported and there is no timeframe in which it will be supported? I am willing to transition to Pnpm in service of switching to Nx, but are there at least plans to make a future transition to PnP easy? |
I'm happy to announce that we are working on the PnP support. A lot of the issues have been resolved already (you can try it out with the latest beta). There are two known issues that we need to fix:
If you can, try this beta and let us know if you find any issues (apart from those listed above). |
@meeroslav this is the best news I have heard all year. Yarn pnp is not perfect but it is a great option to choose in the current JS ecosystem. |
This could not have come at a better time. I was just balancing pure Yarn Workspaces vs Nx specifically because of this issue. |
Swc compiler is fixed in the latest 16.6.0-beta.8 |
How do we enable Plug-n-Play? If I generate a workspace with yarn v3, it successfully uses yarn Berry but does not generate a .pnp.cjs file. It still defaults to using nodeLinker:node-modules. |
You can use this reference: We do not provide a flag for create-nx-workspace to enable PnP automatically. |
Currently, our If you detect any issues with any other package, please report it here. |
The latest beta has all the changes related to Yarn PnP support. This concludes this feature request. If you find any problems with Yarn PnP, please open a new issue. Thank you for your patience! |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Please make sure you have read the submission guidelines before posting an issue
Prerequisites
Yarn version 2.0.0-rc.27
Expected Behavior
Should work correctly like before
Current Behavior
Build failure
Failure Information (for bugs)
An unhandled exception occurred: Cannot locate the 'node_modules' directory.
See "AppData\Local\Temp\ng-mO3oFO\angular-errors.log" for further details.
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Context
Yarn has finally released a usable version two. If you using webpack 4 you need to enable PlugNPlay which is native to webpack 5
https://yarnpkg.com/advanced/migration
https://yarnpkg.com/advanced/pnpapi
Failure Logs
Other
Documentation suggested you add the fallowing into .yarnrc.yml
nodeLinker: node-modules
When then produces the following error
The text was updated successfully, but these errors were encountered: