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 does not detect dependencies with Yarn 3 PNP #25733

Closed
wopian opened this issue Feb 7, 2023 · 11 comments
Closed

Cypress does not detect dependencies with Yarn 3 PNP #25733

wopian opened this issue Feb 7, 2023 · 11 comments
Assignees

Comments

@wopian
Copy link

wopian commented Feb 7, 2023

Current behavior

Shows a warning that vite@4, react@18 and react-dom@18 (or vue@3 in Vue repositories) dependencies are not found when running component tests interactively with Yarn 3 PNP

Screenshot 2023-02-07 at 10 49 10

Desired behavior

No warnings when vite@4, react@18 and react-dom@18 are all installed and listed as dependencies in package.json

Test code to reproduce

Barebones React 18 and Vite 4 reproduction with Yarn 3: https://github.com/wopian/cypress-test-tiny

CircleCI has been changed to use Yarn commands.

Cypress Version

12.5.0

Node version

19.6.0

Operating System

macOS 13.0

Debug Logs

No response

Other

Yarn 3 with Plug 'n' Play.

.yarnrc.yml

cloneConcurrency: 8
defaultSemverRangePrefix: '~'
enableScripts: false
enableTelemetry: false
httpRetry: 3
httpTimeout: 60000
nmMode: hardlinks-global
nodeLinker: pnp
yarnPath: .yarn/releases/yarn-3.3.1.cjs
@wopian
Copy link
Author

wopian commented Feb 7, 2023

This may be a duplicate of #22747 but I am not sure, as I do not get any errors when using Cypress with Yarn 3 PNP or ES Modules - only this warning box before selecting which browser to open tests with on Vue and React apps. Though both issues would likely be fixed with the same module resolution fix.

@warrensplayer
Copy link
Contributor

@wopian This is not a duplicate of #22747 even though they both involve yarn 3. The similarity is that both involve the way the Cypress app relies on looking into the node_modules folder for things, which yarn 3 does not use.

Are you having any issues running your tests? Or are you simply reporting that warning message in your screenshot?

@wopian
Copy link
Author

wopian commented Feb 9, 2023

@warrensplayer reporting the warning message. Tests run without issues

@bensullivan-ag
Copy link

Hi - just wondering if cypress 12 is compatible with yarn 3? I noticed that the cypress factory docker images don't support yarn 3....

@wopian
Copy link
Author

wopian commented Feb 24, 2023

Cypress 12 works fine with Yarn 3 for me after using both for >1 month - it just doesn't detect the package versions of frameworks you target in cypress config when using PnP package linking

@lmiller1990
Copy link
Contributor

Cypress 12 works fine with Yarn 3, except the component testing dependency detection screen isn't working as expected. That's what this ticket is about. It's misleading and confusing, we will fix it by end of March.

I made a new issue #25733 which I'm using to track -- I didn't realize this one already existed when I made that one. Closing this one is favor of the newer one.

@wopian
Copy link
Author

wopian commented Mar 8, 2023

@lmiller1990 you may have linked back to this issue instead of the new issue created 😅

I assume you mean #25960?

@lmiller1990
Copy link
Contributor

Yep, sorry... we will work on #25960 in the next 2 weeks.

@thewordisbird
Copy link

@lmiller1990 thanks for resolving this issue! do you have a timeline on when this is expected to be available in the production build?

@wopian
Copy link
Author

wopian commented Aug 31, 2023

@lmiller1990 thanks for resolving this issue! do you have a timeline on when this is expected to be available in the production build?

5 months ago :)

#25960 (comment)

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Aug 31, 2023

@thewordisbird / @wopian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants