cypress-documentation
cypress-documentation copied to clipboard
Yarn Modern Plug'n'Play incompatibility with CT missing in docs
Subject
Guides > Component Testing
Description
Component testing does not work with Yarn Modern Plug'n'Play and there is no mention in the documentation about compatibility.
The Getting Started examples are all based on npm, e.g. Component Testing > React Component Testing > React Quickstart.
Yarn Modern Plug'n'Play is the default mode for new Yarn Modern installations (when .yarnrc.yml > nodeLinker is either undefined or set to pnp.)
Known open issues
- https://github.com/cypress-io/cypress/issues/26865
- https://github.com/cypress-io/cypress/issues/26859
- https://github.com/cypress-io/cypress/issues/18072
Suggestion
Add new heading in one (or both) of the following to cover package manager compatibility:
"What package managers can be used with component testing?"
This should say that Yarn Modern Plug'n'Play does not currently work with Cypress component testing.
Steps to reproduce
- (from https://github.com/cypress-io/cypress/issues/26865)
git clone --branch yarn-berry-pnp https://github.com/MikeMcC399/component-testing-quickstart-apps
npm install yarn@latest -g
cd component-testing-quickstart-apps/react/my-awesome-app
yarn set version stable
yarn add cypress -D -E
yarn cypress run --component
Note that yarn install produces the warning message:
ESM support for PnP uses the experimental loader API and is therefore experimental
cc: @jordanpowell88
Hi @jordanpowell88 / @marktnoonan
The Yarn blog notes the release of Yarn (Modern) 4.0 on October 23, 2023.
As expected, this hasn't changed any compatibility between Cypress and Yarn's default Plug'n'Play mode. There are still major issues.
If there are no immediate plans by the Cypress team to resolve these incompatibility issues, then it would make sense to acknowledge this in the Cypress documentation and guide users towards using the node-modules compatibility mode and away from the default pnp mode.
When Yarn Modern is used in Plug'n'Play mode yarn install outputs the warning message:
ESM support for PnP uses the experimental loader API and is therefore experimental
It seems that this is the aspect of PnP which causes issues with Cypress.
Hi @jordanpowell88 / @marktnoonan
Do you have any thoughts about this issue? It seems like the documentation ought to be more helpful about what works and doesn't work in terms of Yarn Modern and Cypress Component Testing.