-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 cypress open
does not open Cypress with yarn v2
#6377
Comments
I ran into this - it seems like an error with a dependency relying on an older version of |
@gvdp can you confirm if the workaround provided by @jenkshields fixed your issue? |
I can add that in my case install the dependencies will allow to avoid that error but if you run
the binary starts but the window doesn't show.
|
I'm not able to recreate the installation error with Cypress 4.0.2 (or 3.8.3) and yarn 2. yarn add cypress
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 3.37s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ which@npm:2.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrap-ansi@npm:3.0.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ wrappy@npm:1.0.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yauzl@npm:2.10.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yauzl@npm:2.4.1 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 7.11s
➤ YN0000: ┌ Link step
➤ YN0007: │ cypress@npm:4.0.2 must be built because it never did before or the last one failed
➤ YN0000: └ Completed in 1.75s
➤ YN0000: Done in 12.23s I am able to recreate the 'hanging' when running Debug logs:
|
I had this same issue, but ultimately resolved it. Here's what I found.
That resolves the initial issue. But something else to note in how Cypress works with Yarn 2, it seems that when you run Cypress ( |
@AStoker Thanks for the followup. This would explain why I was not able to replicate as I did not install Yarn 2 globally as they advise. We do recommend the workaround in this comment for installing on Yarn 2 #6377 (comment) We will leave this issue open for the Also @AStoker - make sure you do not have |
yarn cypress open
does not open Cypress with yarn v2
@AStoker @jennifer-shehane Hello, I wasn't able to fix the problem with the steps provided.
I've waited for more than a minute and the Cypress window did not appear for me. My OS details: |
@jennifer-shehane, do you have any tips about debugging this (or is somebody already on it)? I'm not afraid to spend a bit of time trying to help identify what is going on (not sure if I'll be able to solve it though, but hey, that's how open source works, everybody together). However, I'm not familiar with how Cypress hooks into the yarn to be run (and therefore listen to any debug statements). Is there a place you'd recommend I start looking? |
Also, if it's any help, I ran |
I can confirm this problem on my Windows 10 Pro 10.0.18363 machine with the reproduction provided by @DanAtSpark. |
Adding some additional details (and a workaround) for those of you who are on Yarn 2. I haven't been able to figure out exactly how Cypress starts its execution, but I was thinking that potentially the issue was revolving around node trying to identify all the modules required to actually run. Since Yarn 2 doesn't have a node_modules folder and by default uses the PnP setup, I thought that maybe Node was doing what it does when it can't find a library, it goes to the parent directory and looks to see if it has a node_modules folder containing what it needs, and up and up it goes. So I decided to tell yarn to place the node_modules folder back in the directory by adding the nodeLinker plugin as recommended by the Yarn site. Now, when you run In the end, I'd still like to figure out what is exactly happening here and get Cypress to run with the default PnP setup. |
I think #6378 is a duplicate of this one. I made a comment here: #6378 (comment) I have the same issue but I'm not using yarn 2. Removing node_modules, cleaning cypress cache, trying to use cypress 3.6.0 or cypress 4.4.0... Nothing works locally anymore |
@maxime1992 please see my comment #6378 (comment) - your issue is unrelated to the yarn issue. Upgrade to 4.4.1 to get a fix. |
For reference see issues: - cypress-io/cypress#6377 - cypress-io/cypress#8008
I don't use Cypress myself, so I don't plan to dig into that. |
.babelrc
defines plugins
#8364
we are attempting to add support in #15623 . we actually got this working with:
CYP_PATH=$(yarn cypress cache path)
APP_PATH=$(find "$CYP_PATH/6.8.0" -maxdepth 1 -name "Cypress*" -type d)
if [[ "$OSTYPE" == "darwin"* ]]; then
RESOURCE_PATH="$APP_PATH/Contents/Resources"
SED_ARGS="-i \"\""
else
RESOURCE_PATH="$APP_PATH/resources"
SED_ARGS="-i"
fi
FILE_PATH="$RESOURCE_PATH/app/packages/server/lib/util/resolve.js"
sed $SED_ARGS "s/resolve.sync.*/require.resolve('typescript', { paths: [projectRoot] })/g" "$FILE_PATH"
echo "done!"
however ive been struggling to get the monkey patch to work with cypress 7.1.0. it would be great to have more help from the cypress team on this one since it requires getting pretty deep into how plugins are registered |
Its seems cypress 6 is working. 7 is not. build hangs forever. |
I works with v6.9.1, but not with v9.2.0 😞 |
I'm unable to recreate this issue using the steps provided:
Cypress launches as expected and is able to run tests. I'm using yarn 3.1.1, node16.5.0, and cypress 9.2.0 on macOS 11.6.2 |
For posterity since this issue is quite old: yarn 2/pnp support was officially added in @jennifer-shehane Does this issue want to be closed? |
I need to amend my previous statement I am able to recreate cypress open failing when using yarn 2.4.3. mkdir test-project Click the todo spec and cypress fails with the following error. |
Try running |
@arcanis, yep, yarn 3.1.1 works fine for me. |
Cypress 9.5.1 fixed it for me with yarn 3.2 (which repro'd this issue for me before), with #19792. |
Current behavior:
Not sure if this really has to do with yarn (v2) but adding the latest cypress version to a project fails for me. It successfully installs when I use npm.
Stacktrace:
Content of logfile-6119EAzUDTs6CGBm.log:
Desired behavior:
A succesfull install
Test code to reproduce
New folder
yarn init
yarn add --dev cypress@4.0.0
Versions
yarn : 2.0.0-rc.27
cypress: 4.0.0
OS: macOS Catalina 10.15.3
The text was updated successfully, but these errors were encountered: