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

Cypress config error after CT migration to Yarn Plug'n'Play #26865

Closed
MikeMcC399 opened this issue May 26, 2023 · 6 comments
Closed

Cypress config error after CT migration to Yarn Plug'n'Play #26865

MikeMcC399 opened this issue May 26, 2023 · 6 comments
Labels
CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented May 26, 2023

Current behavior

If a working Cypress Component Testing environment is converted to use Yarn Plug'n'Play, Cypress fails to start and reports "Your config file is invalid". In this case neither CT nor E2E testing can be carried out.

The exact error depends on which framework was configured.

The previous working environment could be npm, Yarn Classic (version 1) or Yarn Modern (version 3 or 4) configured with nodeLinker: node-modules. Each of these environments works with CT.

Environment Error
Angular 17 TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
React Error: require() of ES Module cypress.config.js from Cypress\Cache\13.6.4\Cypress\resources\app\node_modules@packages\server\lib\plugins\child\run_require_async_child.js not supported.
Svelte as for React
Vue as for React

Desired behavior

Cypress component testing should be compatible with Yarn Plug'n'Play.

If a project is correctly configured, then the command yarn cypress run --component should execute without errors.

Test code to reproduce

From clone of https://github.com/MikeMcC399/component-testing-quickstart-apps (fork of https://github.com/cypress-io/component-testing-quickstart-apps)

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

alternatively

yarn cypress open --component

Cypress Version

First reported on Cypress 12.13.0
Continues to be reproducible on Cypress 13.13.0

Yarn version

4.0.2 4.3.1

Node version

18.18.2 / 20.11.1

Operating System

Ubuntu 22.04.3 (also on Windows 11)

Debug Logs

debug.log

Regular log on https://github.com/MikeMcC399/component-testing-quickstart-apps/actions/runs/5903678483.

Other

Branch yarn-berry-node in https://github.com/MikeMcC399/component-testing-quickstart-apps demonstrates Yarn Modern (3.5.1 4.0.2) with nodeLinker: node-modules configured in .yarnrc.yml successfully running Component Testing.

The other examples in the repository are also set up for testing:

cd angular/my-awesome-app
yarn install
yarn cypress run --component
cd svelte/my-awesome-app
yarn install
yarn cypress run --component
cd vue/my-awesome-app
yarn install
yarn cypress run --component

to access and test them.

@mike-plummer mike-plummer added Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. CT Issue related to component testing labels Jun 26, 2023
@mike-plummer
Copy link
Contributor

Thanks @MikeMcC399! This will likely be related to work needed to resolve #26859.

I will forward this ticket to the appropriate team. They will evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate any status changes. Thanks!

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399

This comment was marked as outdated.

@mike-plummer mike-plummer removed their assignment Feb 26, 2024
@waldemarennsaed
Copy link

Is this issue still to be worked on? I still face issues using Yarn 4, PnP and Cypress 13.13.2 .

@jennifer-shehane
Copy link
Member

Not currently

@MikeMcC399
Copy link
Contributor Author

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug
Projects
None yet
Development

No branches or pull requests

5 participants