cypress-documentation icon indicating copy to clipboard operation
cypress-documentation copied to clipboard

Yarn Modern Plug'n'Play incompatibility with CT missing in docs

Open MikeMcC399 opened this issue 2 years ago • 3 comments

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

MikeMcC399 avatar Jul 24 '23 12:07 MikeMcC399

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.

MikeMcC399 avatar Oct 26 '23 10:10 MikeMcC399

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.

image

MikeMcC399 avatar Nov 01 '23 07:11 MikeMcC399

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.

MikeMcC399 avatar Feb 29 '24 11:02 MikeMcC399