After updating to Cypress 3.5.0 I'm not able to open the Cypress GUI nor to run cypress run anymore. I'm using the Vue-Plugin "cli-plugin-e2e-cypress". I receiving the following error-message:
ERROR Error: Command failed: C:\Users\localuser\Desktop\TEST\node_modules\cypress\bin\cypress run --config baseUrl=http://localhost:8082/
Error: Command failed: C:\Users\localuser\Desktop\TEST\node_modules\cypress\bin\cypress run --config baseUrl=http://localhost:8082/
at makeError (C:\Users\localuser\Desktop\TEST\node_modules\execa\index.js:174:9)
at Promise.all.then.arr (C:\Users\localuser\Desktop\TEST\node_modules\execa\index.js:278:16)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I should be able to run my test with "cypress run" or open the GUI with "cypress open"
We also have this issue. Passing any arguments (--config baseUrl=https://localhost:56949) is not possible any more. Cypress will immediately terminate.
I tested and on Linux it works. It seems that cypress.cmd is broken.
On Windows cypress.cmd open without any argument works fine, as soon as a command line argument is present, it immediately exits (exit code 0).
As a workaround you can use environment variables to set the cypress configs. https://docs.cypress.io/guides/guides/environment-variables.html#Option-4-env
Are you all using the cli-plugin-e2e-cypress
from Vue? Please we need to know exactly. We have lots of tests around Windows, passing env vars in this way, so we need to narrow the issue down to begin investigating.
Can you also confirm what arguments you are seeing, I know someone say 'any arguments', but all of the examples have config
, can you confirm the exact arguments that make it fail, thank you.
The reason I ask is because the cli-plugin-e2e-cypress
plugin specifically handles the config
argument, and more specifically the baseURL
argument passed to that. This may be a bug in their plugin. https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-plugin-e2e-cypress/index.js#L31
I'm using it on a react project: npx cypress run --env BASE_URL=https://****.azurewebsites.net
It works with Cypress 3.4.1 but not with 3.5. it doesnt show any error message just terminate
I use it on Windows
@jennifer-shehane
We are not using the cli-plugin-e2e-cypress
, "just" cypress w/ webpack-preprocessor
(for TypeScript support).
It terminates immediately when providing the --config
switch. When starting cypress w/o the config-switch it runs normally. (except the fact that base-url is not set correctly)
Example of how we are using cypress:
cypress open/run --project <subfolder> --config baseUrl=<baseUrl> --env user=<user>,password=<password>
We're using it plain installed via npm from command line and Gradle. When passing either --config
or --env
or both it immediately exits (only on Windows).
Hey everyone,
Could you run Cypress in debug mode mode and print the entire set of logs here? Please include the error you are seeing also.
Output from running cypress with set DEBUG=cypress:*
:
yarn run v1.19.0
$ set DEBUG=cypress:* && cypress open --project ./integration --config baseUrl=http://localhost:23814 --env user=******,password=******
cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\Repository\\node_modules\\cypress\\bin\\cypress","open","--project","./integration","--config","baseUrl=http://localhost:23814","--env","user=******,password=******"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +4ms
cypress:cli opening Cypress +1ms
cypress:cli parsed cli options { project: './integration',
env: 'user=******,password=******',
config: 'baseUrl=http://localhost:23814' } +133ms
cypress:cli opening from options {"project":"./integration","env":"user=******,password=******","config":"baseUrl=http://localhost:23814"} +0ms
cypress:cli command line arguments ["--env","user=******,password=******","--config","baseUrl=http://localhost:23814","--project","./integration"] +1ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +31ms
cypress:cli checking if executable exists C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +4ms
cypress:cli Binary is executable? : true +6ms
cypress:cli binaryDir is C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress +33ms
cypress:cli Reading binary package.json from: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\package.json +0ms
cypress:cli Found binary version 3.5.0 installed in: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress +6ms
cypress:cli { verified: true } +6ms
cypress:cli is Verified ? true +3ms
cypress:cli needs to start own Xvfb? false +0ms
cypress:cli spawning, should retry on display problem? false +28ms
cypress:cli spawning Cypress with executable: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +7ms
cypress:cli spawn args [ '--env', 'user=******,password=******', '--config', 'baseUrl=http://localhost:23814', '--project', './integration', '--cwd', 'C:\\Repository' ] { detached: false, stdio: 'inherit', windowsHide: false } +31ms
cypress:cli child event fired { event: 'exit', code: 4294967295, signal: null } +2s
cypress:cli child event fired { event: 'close', code: 4294967295, signal: null } +3ms
Done in 2.91s.
Output from running cypress with set DEBUG=cypress:*:
F:\Project\hub>npx cypress run --env BASE_URL=https://****.azurewebsites.net
cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","F:\\Project\\hub\\node_modules\\cypress\\bin\\cypress","run","--env","BASE_URL=https://****.azurewebsites.net"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +2ms
cypress:cli running Cypress +1ms
cypress:cli parsed cli options { env: 'BASE_URL=https://****.azurewebsites.net' } +56ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +0ms
cypress:cli checking if executable exists C:\Users\****\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +2ms cypress:cli Binary is executable? : true +1ms
cypress:cli binaryDir is C:\Users\****\AppData\Local\Cypress\Cache\3.5.0\Cypress +0ms
cypress:cli Reading binary package.json from: C:\Users\****\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\package.json +0ms
cypress:cli Found binary version 3.5.0 installed in: C:\Users\****\AppData\Local\Cypress\Cache\3.5.0\Cypress +2ms
cypress:cli { verified: true } +2ms
cypress:cli is Verified ? true +1ms
cypress:cli processing run options +0ms
cypress:cli --key is not set, looking up environment variable CYPRESS_RECORD_KEY +1ms
cypress:cli run to spawn.start args ["--run-project","F:\\Project\\hub","--env","BASE_URL=https://****.azurewebsites.net"] +0ms
cypress:cli needs to start own Xvfb? false +0ms
cypress:cli spawning, should retry on display problem? false +0ms
cypress:cli spawning Cypress with executable: C:\Users\****\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +7ms
cypress:cli spawn args [ '--run-project', 'F:\\Project\\hub', '--env', 'BASE_URL=https://****.azurewebsites.net', '--cwd', 'F:\\Project\\hub' ] { detached: false, stdio: 'pipe', windowsHide: false } +1ms
cypress:cli piping process STDIN into child STDIN +8ms
cypress:cli piping child STDOUT to process STDOUT +0ms
cypress:cli piping child STDERR to process STDERR +1ms
cypress:cli child event fired { event: 'exit', code: 4294967295, signal: null } +16ms
cypress:cli child event fired { event: 'close', code: 4294967295, signal: null } +1ms
Same problem here. As a workaround I could use --config-file
parameter.
I have the same problem too on both 3.5 and 3.6 versions.
I think this may be occurring due to a change in Electron (which we upgraded) where they strip arguments after an argument containing a url. Seems localized to Windows though. https://github.com/electron/electron/pull/13039
--browser chrome
to an installed Chrome browser would fix this issue.
- Can everyone confirm/deny if the arguments being passed during the error contain a url somewhere in the arguments list and that removing this url solves the issue?
Moving thebaseUrl
from the arguments into the config-file solves it.
- Also if this is true, this should not be happening in Chrome, so potentially passing --browser chrome to an installed Chrome browser would fix this issue.
Passing --browser chrome
does not help. Debug output below:
yarn run v1.19.0
$ set DEBUG=cypress:* && cypress run --project ./integration --config baseUrl=http://localhost:23814 --env user=******,password=****** --browser chrome
cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\Repository\\node_modules\\cypress\\bin\\cypress","run","--project","./integration","--config","baseUrl=http://localhost:23814","--env","user=******,password=******","--browser","chrome"] +0ms
cypress:cli NODE_OPTIONS is not set +0ms
cypress:cli program parsing arguments +26ms
cypress:cli running Cypress +2ms
cypress:cli parsed cli options { project: './integration',
env: 'user=******,password=******',
config: 'baseUrl=http://localhost:23814',
browser: 'chrome' } +115ms
cypress:cli verifying Cypress app +0ms
cypress:cli checking environment variables +20ms
cypress:cli checking if executable exists C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +3ms
cypress:cli Binary is executable? : true +2ms
cypress:cli binaryDir is C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress +1ms
cypress:cli Reading binary package.json from: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\resources\app\package.json +0ms
cypress:cli Found binary version 3.5.0 installed in: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress +23ms
cypress:cli { verified: true } +24ms
cypress:cli is Verified ? true +3ms
cypress:cli processing run options +0ms
cypress:cli --key is not set, looking up environment variable CYPRESS_RECORD_KEY +1ms
cypress:cli run to spawn.start args ["--run-project","./integration","--env","user=******,password=******","--config","baseUrl=http://localhost:23814","--browser","chrome"] +0ms
cypress:cli needs to start own Xvfb? false +0ms
cypress:cli spawning, should retry on display problem? false +1ms
cypress:cli spawning Cypress with executable: C:\Users\pf\AppData\Local\Cypress\Cache\3.5.0\Cypress\Cypress.exe +4ms
cypress:cli spawn args [ '--run-project', './integration', '--env', 'user=******,password=******', '--config', 'baseUrl=http://localhost:23814', '--browser', 'chrome', '--cwd', 'C:\\Repository' ] { detached: false, stdio: 'pipe', windowsHide: false } +0ms
cypress:cli piping process STDIN into child STDIN +33ms
cypress:cli piping child STDOUT to process STDOUT +1ms
cypress:cli piping child STDERR to process STDERR +0ms
cypress:cli child event fired { event: 'exit', code: 4294967295, signal: null } +859ms
cypress:cli child event fired { event: 'close', code: 4294967295, signal: null } +1ms
That Electron PR allows for urls when the args are prefaced with extra --
, e.g.:
npx cypress open -- --config baseUrl=https://google.com
Sadly, Cypress doesn't parse arguments in this format. I'm not sure how args in this format are passed to the Electron app, but it may be the only fix Cypress could do downstream.
EDIT: in fact, looking at DEBUG, I think all that cypress needs to do is prepend --
when spawning the process.
Can confirm its windows only, exactly the same setup works just fine in linux, but fails with this issue on windows
Same here. Works on MacOS but fails on windows:
cypress open --env server=https://my.server.com
Same issue with us
@jennifer-shehane can we please get an update as to when this will be fixed
Another workaround is to launch cypress from the node module API. You pass the config as a js object and this still works fine on Windows.
Same issue with vue-service-cli command test:e2e. It runs the following commands cypress run --config baseUrl=http://localhost:8080/kp/
and as other found, the --config parameter is the cause.
Same here. Issue arose when upgrading from 3.4.1 to 3.5.0/3.6.1/3.7.0. Both with test runner and headless mode. See #5843 and #5710
Confirming v3.7.0 on Windows is crashing
cypress:cli spawning Cypress with executable: C:\Users\Administrator\AppData\Local\Cypress\Cache\3.7.0\Cypress\Cypress.exe +0ms
cypress:cli spawn args [ '--run-project', 'c:\\Users\\Administrator\\test-crash-5466', '--config', 'baseUrl=http://foo', '--cwd', 'c:\\Users\\Administrator\\test-crash-5466' ] { detached: false, stdio: 'pipe', windowsHide: false } +0ms
cypress:cli piping process STDIN into child STDIN +172ms
cypress:cli piping child STDOUT to process STDOUT +0ms
cypress:cli piping child STDERR to process STDERR +0ms
cypress:cli child event fired { event: 'exit', code: 4294967295, signal: null } +31ms
cypress:cli child event fired { event: 'close', code: 4294967295, signal: null } +0ms
Even passing an url inside --env
crashes the child process.
Working: npx cypress run --env foo=http//foo
Not working:
Hmm, when I comment out --cwd
argument and options object to child_process.spawn
it is working
cypress:cli spawn args [ '--run-project', 'c:\\Users\\Administrator\\test-crash-5466', '--env', 'foo=http://foo' ] { detached: false, stdio: 'inherit', windowsHide: false } +0ms
cypress:cli piping process STDIN into child STDIN +188ms
cypress:cli piping child STDOUT to process STDOUT +0ms
cypress:cli piping child STDERR to process STDERR +0ms
2019-12-02T22:12:44.261Z cypress:server:cypress starting cypress with argv [ 'C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\3.7.0\\Cypress\\Cypress.exe', '--run-project', 'c:\\Users\\Administrator\\test-crash-5466', '--env', 'foo=http://foo' ]
2019-12-02T22:12:44.877Z cypress:server:cypress starting in mode run
It looks like you are running the Cypress binary directly.
This is not the recommended approach, and Cypress may not work correctly.
Please install the 'cypress' NPM package and follow the instructions here:
https://on.cypress.io/installing-cypress
2019-12-02T22:12:44.880Z cypress:server:cypress running Electron currently
Interesting - it seems by adding "dummy" '--' to the arguments when spawning the child process I can make the Electron work - just like this comment suggests https://github.com/cypress-io/cypress/issues/5466#issuecomment-550343870
cypress:cli spawn args [ '--run-project', 'c:\\Users\\Administrator\\test-crash-5466', '--', '--env', 'foo=http://foo', '--bar' ] { detached: false, stdio: 'inherit', windowsHide: false } +0ms
cypress:cli piping process STDIN into child STDIN +172ms
cypress:cli piping child STDOUT to process STDOUT +16ms
cypress:cli piping child STDERR to process STDERR +0ms
2019-12-02T22:21:17.350Z cypress:server:cypress starting cypress with argv [ 'C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\3.7.0\\Cypress\\Cypress.exe', '--run-project', 'c:\\Users\\Administrator\\test-crash-5466', '--', '--env', 'foo=http://foo', '--bar' ]
2019-12-02T22:21:17.985Z cypress:server:cypress starting in mode run
Added a failing test to test project https://github.com/cypress-io/cypress-example-todomvc/tree/3.7.1 - and updated AppVeyor to confirm it fails
@bahmutov no need to reverse-engineer/guess what's going on. It's a known feature of new Electron versions, as @jennifer-shehane linked.
https://github.com/electron/electron/pull/13039 (fixing https://github.com/electron/electron/issues/13226#issuecomment-397973671)
The code for this is done in cypress-io/cypress#5853, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Thanks for getting this fixed! Do we know approximately when this will be released?
Any chance this will release this week? I have some E2E test pipelines in our deploy process that I'd love to get updated waiting on this fix. If there's anything I can do to help, I'd be happy to.
Any chance this will release this week? I have some E2E test pipelines in our deploy process that I'd love to get updated waiting on this fix. If there's anything I can do to help, I'd be happy to.
Oh, yes. It would be nice. We desperately need this fix asap. Impossible for us to upgrade from 3.4.1 to newer versions with this bug. Have been trying for weeks.
Yep, we've got a project blocked only by this issue as well. Any information as to when this will be fixed would be appreciated.
We also are unable to upgrade from 3.4.1
Released in 3.8.0
.
Most helpful comment
We also have this issue. Passing any arguments (--config baseUrl=https://localhost:56949) is not possible any more. Cypress will immediately terminate.